AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[module] Toolbar v2.31
Goto page Previous  1, 2, 3, 4, 5  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
DHMH



Joined: 17 Jul 2008
Posts: 225

PostPosted: Fri Feb 20, 2009 12:18 pm    Post subject: Reply with quote

thank you, but my question was, how can i create a toolbar like word, with the same buttons ?
( Screenshot:

)
?
Greets,
DHMH Laughing
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Fri Feb 20, 2009 2:01 pm    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message
fincs



Joined: 05 May 2007
Posts: 1163
Location: Seville, Spain

PostPosted: Sat Mar 07, 2009 5:46 pm    Post subject: Reply with quote

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
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Thu Jul 09, 2009 10:00 am    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Tue Jul 21, 2009 11:52 pm    Post subject: Double-click bug? Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Sun Jul 26, 2009 6:51 pm    Post subject: Reply with quote

Confirmed. I will see how to fix this.
_________________
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Mon Jul 27, 2009 4:19 pm    Post subject: Reply with quote

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 ?
_________________
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Tue Jul 28, 2009 3:43 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Tue Jul 28, 2009 11:44 am    Post subject: Reply with quote

v 2.12 by jballi

- bug fix for problem described here

- new event - rclick
_________________
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Fri Jul 31, 2009 1:14 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Fri Jul 31, 2009 2:50 am    Post subject: Reply with 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 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.
Back to top
View user's profile Send private message Send e-mail
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Fri Jul 31, 2009 11:04 am    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Fri Jul 31, 2009 12:02 pm    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Sat Aug 01, 2009 12:22 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message Send e-mail
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Sat Aug 01, 2009 7:38 am    Post subject: Reply with quote

fixed
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 2 of 5

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group