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
hughman



Joined: 11 Feb 2007
Posts: 166

PostPosted: Tue Aug 25, 2009 10:18 am    Post subject: Reply with quote

I copy this word nodivder from your doc. So it's your fault Laughing
Back to top
View user's profile Send private message
jballi



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

PostPosted: Thu Aug 27, 2009 6:15 pm    Post subject: Reply with quote

I just got a chance to download and do a preliminary test of v2.2. It seems to do the trick. Thanks. Cool
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 Aug 28, 2009 11:45 pm    Post subject: Reply with quote

Minor bug (I think). The values for the width and height parameters of the Toolbar_SetButtonSize function appear to be transposed when used as values for the TB_SETBUTTONSIZE message. Toolbar_SetButtonSize(hToolbar,100,30) will give you very tall buttons instead of the expected very wide buttons. Toolbar_SetButtonSize(hToolbar,30,100) will give you very wide buttons.

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: Sat Aug 29, 2009 9:22 am    Post subject: Reply with quote

** v 2.21 **

! SetButtonSize bug fixed
+ SetDrawTextFlags added.
_________________
Back to top
View user's profile Send private message
fincs



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

PostPosted: Sat Aug 29, 2009 11:20 am    Post subject: Reply with quote

Thanks, maybe this new release fixes my Win98 problem Smile
_________________
fincs
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]
Back to top
View user's profile Send private message
jballi



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

PostPosted: Fri Dec 11, 2009 10:25 am    Post subject: Reply with quote

Fat toolbar phenomenon.

Using the DropDown button style on any of the active toolbar buttons adds an additional 8 pixels of height to the entire toolbar. I've tried every trick in the book but there doesn't appear to be any way to get rid of the additional height until all buttons with the DropDown button style are removed from the list of active buttons. To see an example of this idiosyncrasy, just add the DropDown button style to one or more buttons on any of the examples that come with the Toolbar library. Depending on the script, you might need to add the Border style to the toolbar to see that height has increased.

8 pixels is not a huge deal but it makes the entire toolbar look fat. I looked a few utilities that I have that use a toolbar with dropdown buttons and none of them have this fat toolbar problem.

Thank you for your consideration. Any help would be appreciated.
Back to top
View user's profile Send private message Send e-mail
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Fri Dec 11, 2009 12:09 pm    Post subject: Reply with quote

deleted
_________________


Last edited by majkinetor on Fri Dec 11, 2009 12:34 pm; edited 2 times in total
Back to top
View user's profile Send private message
jballi



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

PostPosted: Fri Dec 11, 2009 12:26 pm    Post subject: Reply with quote

majkinetor wrote:
Using SetButtonSize will remove the additional height but that function doesn't work with toolbars that have LIST style.

Tried it. No good. My toolbar uses the LIST style.

majkinetor wrote:
You could also try to remove it by specifying position and size of the toolbar manually by using last parameter of Add function.

This might work initially buy my toolbar is using multiple ILs with different icon sizes so the problem would show up any time changes to toolbar were made. I'll give a try/see anyway to see what happens.

majkinetor wrote:
TBH, I don't know why it happens, the same as I don't know why additional height is side effect of adding splitters.

I guess we're in the same boat. Thanks for taking a look at it. If you think of anything, make a noise.
Back to top
View user's profile Send private message Send e-mail
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Fri Dec 11, 2009 12:34 pm    Post subject: Reply with quote

Found the problem.

Code:
Toolbar_Insert(hCtrl, Btns, Pos=""){
   static TB_INSERTA = 0x414, TB_INSERTBUTTONA=0x415

   cnt := Toolbar_compileButtons(hCtrl, Btns, cBTN)
   if Pos =
      SendMessage, TB_INSERTA, cnt, cBTN ,, ahk_id %hCtrl%
   else loop, %cnt%
      SendMessage, TB_INSERTBUTTONA, Pos+A_Index-2, cBTN + 20*(A_Index-1) ,, ahk_id %hCtrl%

   Toolbar_mfree(cBTN)

   ;for some reason, you need to call this 2 times for proper results in some scenarios .... !?
   SendMessage,0x421,,,,ahk_id %hCtrl%   ;autosize
    SendMessage,0x421,,,,ahk_id %hCtrl%   ;autosize

}


Comment autosize messages and it might be OK.
But, I don't know what scenarios I am refering here.... *** makes mental note to describe things more in the code ***

This doesn't solve the issue of invalid toolbar size with separators tho.

I actually used autosize messages on different places . Perhaps all should be removed with this problem in light. Search for 0x421 messages and remove them all except from AutoSize function.


EDIT:
Actually, after I removed AS messages, many samples didn't render correctly even _Simple.ahk. Will see more about it but this must be the problem ....

EDIT2
Actually, removing AS messages seems to do nothing about button size Very Happy

In _Test.ahk something strange happens. Initially everything looks OK but GetButtonSize returns that height is 75 instead 67. Then when I add another button, it starts to show how it rly looks like and function still returns 75.
_________________


Last edited by majkinetor on Fri Dec 11, 2009 1:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Fri Dec 11, 2009 1:23 pm    Post subject: Reply with quote

*** Version 2.31 ***

+ Added GetButtonSize
* Removed AutoSize messages in SetButtonWidth, SetButtonSize, SetMaxTextRows
+ Added AutoSize & GetButtonSize in _Test.ahk
+ Added CheckButton
+ Small docs and structure fixes


2jballi
I made some small changes and added new buttons in _Test.ahk that are needed to troubleshoot fat toolbar problem. I also removed AS messages from some places that might undo the changes. This might show some stuff that are unusual. For instance, if you do GetButtonSize and then SetButtonSize asap, nothing changes. However if you change only height part in what GBS returned, and use SBS to set it, both width & height will change.
_________________
Back to top
View user's profile Send private message
jballi



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

PostPosted: Sat Dec 12, 2009 12:51 am    Post subject: Reply with quote

Thanks for the update. Smile This will keep me busy for a while.

majkinetor wrote:
EDIT2
Actually, removing AS messages seems to do nothing about button size Very Happy

Right. Adding the DropDown button style appears to increase the minimum height of the (all?) button(s) on the toolbar. You can make the toolbar buttons bigger but you can't make them smaller than the minimum size.
Back to top
View user's profile Send private message Send e-mail
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Sat Dec 12, 2009 12:33 pm    Post subject: Reply with quote

Did you try TB_SETMETRICS maybe to fix the visuals ?

Anyway, I kinda successfully restore what apperas to be normal if I use SetButtonSize after I add dropdown button and AutoSize afterwards.

1. Open _Test.ahk and press GBS. I get 59,75
2. Enter 60 and press SBS, then Autosize.
3. GBS now returns 66,68. Its little wider but not that fat Smile

Interestingly, if you now use SetButtonWidth and use 60, it will restore height to 75....
_________________
Back to top
View user's profile Send private message
jballi



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

PostPosted: Sun Dec 13, 2009 2:33 pm    Post subject: Reply with quote

majkinetor wrote:
Did you try TB_SETMETRICS maybe to fix the visuals ?

My initial tests indicate that the TB_SETMETRICS message might provide some value but it might require some extra code because you can only remove button padding when at least one dropdown button is showing on the toolbar. If no dropdown buttons are showing, removing extra padding makes the buttons look very odd. I also discovered that you can't use the message any time. It can only be used after the toolbar has been created but before the image list has been assigned and/or before the buttons have been added. I'm not exactly what the sequence is yet.

Thanks for the tip. I'll see if it pans out.

Edit 20091213_2334: So far, so good. I'm doing it before I set/reset an IL to toolbar. I don't know where else it will work.
Back to top
View user's profile Send private message Send e-mail
Delusion



Joined: 16 Jul 2008
Posts: 213
Location: Greece/Rhodos

PostPosted: Sat Jan 02, 2010 10:38 pm    Post subject: Reply with quote

many thanks for this...its great! Very Happy
_________________
Popcorn Movie Db
Simple Apnea Trainer
Back to top
View user's profile Send private message Visit poster's website
Petru



Joined: 17 Dec 2007
Posts: 235
Location: Galati, Romania

PostPosted: Sun Jun 06, 2010 11:29 pm    Post subject: unicode Reply with quote

Don't know if someone saw that, but in AutohotkeyU, only the first letter of the toolbar caption is shown. How to fix this?
Back to top
View user's profile Send private message Yahoo Messenger
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 4 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