AutoHotkey Community

It is currently May 26th, 2012, 9:23 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: February 20th, 2009, 1:18 pm 
Offline

Joined: July 17th, 2008, 9:46 am
Posts: 225
thank you, but my question was, how can i create a toolbar like word, with the same buttons ?
( Screenshot:
Image
)
?
Greets,
DHMH :lol:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2009, 3:01 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Its just a background image, nothing more.

How to add background image, I don't know from the head (its probably rebar background picture and transparent toolbar but maybe toolbar allows for picture too)

You also need rebar module for multiple tooblars as you did show on the picture.

It probably requires some trivial updates of mentioned modules to allow for background picture since I don't remember including that into ahk API.

If you want stylish toolbars, you will need some work done by urself (I am not going to provide sample)

Other then that its simply toolbar with LIST style set so that some buttons can have text while others not.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2009, 6:46 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
Hi,
I'm trying to create a toolbar without text and with tooltips ("FLAT LIST TOOLTIPS"), and it works fine under
Windows Vista, but if I move the same program to Windows 98 the tooltip
text is displayed in the button and there's no tooltip.
I've then (followed MSDN and) used "FLAT TOOLTIPS" and did a Toolbar_SetMaxTextRows(hToolbar, 0),
it continues to work fine under Windows Vista but it creates a button too wide under Windows 98:
Code:
---------------
|      I      |
---------------
when it should be:
---
|I|
---
(I: the icon)

Now I've set the autosize style for each button, but the problem persists!
Can you tell me what I'm doing wrong?

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 9th, 2009, 11:00 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
fincs, I don't use Win98 so I can't help.

version: 2.1
- All globals removed
- API changes:
  o Handler signature changed so Text now comes before Pos.
  o AddButtons renamed to Insert
o Many parameter names changed.
- Chainable onNotify so you can use it with other custom controls.
- Improved samples.
- Small changes.
- Tutorial links now works correctly.


The API is changing in sync for all custom controls I made so that it is more uniform and require less learning if you already know one of them.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Double-click bug?
PostPosted: July 22nd, 2009, 12:52 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 775
Location: Texas, USA
I've been having fun playing around with this library trying to get it to work with one of my small apps. I ran into an anomaly that is a bit troubling. I call it an anomaly instead of a bug because I don't know the library well enough to label it as a bug.

The problem: Double-clicking on the title bar to maximize the window will cause a toolbar buttons to fire if the toolbar button is in the same location as the cursor when the window becomes maximized. There are workarounds but it would be nice if the library code could recognize the difference between a click and the tail-end of a double-click.

I can just see a user double-clicking on a title bar to maximize a window only to get a "Are you sure you want to reformat the hard drive?" prompt!

Thank you for your consideration.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2009, 7:51 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Confirmed. I will see how to fix this.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2009, 5:19 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Toolbar receives NM_CLICK as code (-2) in its private function responsible for dispatching events, Toolbar_onNotify. I created automated sample of this problem and some other notifications are sent depending on style, but -2 is always sent.

The problem is very stupid, its very strange you even discovered it: window is maximized on L click and L down, while button fires on L up.... Plus, the window must be out of screen in non maximized state.... strange sht and its system's fault.

I cant differentiate this from the module itself without monitoring max/restore messages which doesn't sound right.

Check the sample, (you may need to change some coordinates)

Code:
#SingleInstance, force
   Gui, +LastFound +Resize
   hGui := WinExist()
   Gui, Show , w410 h180 Hide      ;set gui width & height (mandatory)

   hToolbar := Toolbar_Add(hGui, "OnToolbar", "ADJUSTABLE FLAT", 1)

   
      btns =
      (LTrim
         cut
         copy
         paste
         -
         undo
         redo
      )
   
   Toolbar_Insert(hToolbar, btns)
   Gui, Add, Text, x0 y85 w180
   Gui, Show,x0 y-20 ,Customization Test

   WinMaximize, A
   MouseMove, 40, 15
   Sleep 150
   Click, 2
return


OnToolbar(hToolbar, pEvent, pTxt, pPos, pID){

   if pEvent = click
      ControlSetText, Static1, Clicked: %pTxt% (%pPos%)
}

GuiClose:
   ExitApp
return

#include Toolbar.ahk


I also added OutputDebug %code% in onNotify to see whats going on...


I am not sure how to "fix" this. I guess one of the means is to not monitor NM_CLICK but maybe some other msg, like NM_LDOWN. Replace this line in onNotify:
if (code = NM_CLICK)

with
if (code = -20)

and see how it works for you...

Because of this problem it may be the best to change click notification to use NM_LDOWN or, to have both messages in place as NM_CLICK can be used with windows not having maximize option without problems.

Do you maybe have some other solution in mind ?

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 28th, 2009, 4:43 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 775
Location: Texas, USA
I have a couple of ideas. Let me put some brain energy into it (a big effort for me I'm sure). I'll PM you when I have more information.

Edit: I think I have a usable fix. Check your PM box.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 28th, 2009, 12:44 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
v 2.12 by jballi

- bug fix for problem described here

- new event - rclick

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2009, 2:14 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 775
Location: Texas, USA
Found a minor thing. For the "SHOWTEXT" button style the documentation states, "You can create multiline tooltips by using $ in the tooltip caption." I tried it and the "$" character just shows up in the tooltip. Ex: Copy$stuff...

I may be doing something wrong. If so, please set me on the right path.

Thank you for your consideration.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2009, 3:50 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 775
Location: Texas, USA
Found another problem. The Toolbar_Define function does not return a value that is usable by other Toolbar functions, specifically the Toolbar_Insert function. I tried to use the value returned by the Define function and received the following script error when trying to Insert the buttons:

Quote:
The following variable name contains an illegal character:
"BTNS_

The current thread will exit.

.
.
.
---> 710: hstyle |= BTNS_%A_LOOPFIELD%
.
.


This is probably a parsing problem. I looked at the value returned by the Toolbar_Define function and found a mix of CR and LF characters. Most of the lines (not all) end with CRCRLF.

Personally, I would like the value returned from the Toolbar_Define to be the same as it was original defined by the developer (no CR characters) but I'm sure I haven't considered all of the issues.

Thank you for your consideration. Let me know if you need any additional information.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2009, 12:04 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
Found a minor thing. For the "SHOWTEXT" button style the documentation states, "You can create multiline tooltips by using $ in the tooltip caption

Its wrongly documented. Its `r, not $. I fixed docs.

Quote:
Found another problem. The Toolbar_Define function does not return a value that is usable by other Toolbar functions, specifically the Toolbar_Insert function

I see, CR LF in Define as new line, only LF in insert... Its easy to workaround this but I will change it for the sake of principle of last surprise.


Thx.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2009, 1:02 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
v 2.13

- Fixed docs error with $ as new line
- Changed Define to return equal list as u feed into Insert.
- Additional documentation changes and remarks.
- Some other small changes.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2009, 1:22 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 775
Location: Texas, USA
majkinetor wrote:
v 2.13

- Fixed docs error with $ as new line
- Changed Define to return equal list as u feed into Insert.
- Additional documentation changes and remarks.
- Some other small changes.

Link still points to v2.12. Can you fix?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2009, 8:38 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
fixed

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: MSN [Bot] and 13 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group