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 Control 1.0 b1
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Wed Jan 09, 2008 5:04 pm    Post subject: [module] Toolbar Control 1.0 b1 Reply with quote




To do:
- Arrow buttons (buttons that have small down arrow next to them that can be clicked for list of options) (done in test)
- Tooltips (done in test)
- The way to add separators when toolbar is used with image lists. (done in test)
- Notification interface
_________________


Last edited by majkinetor on Sat Jan 12, 2008 10:58 pm; edited 7 times in total
Back to top
View user's profile Send private message MSN Messenger
freakkk



Joined: 29 Jul 2005
Posts: 128

PostPosted: Wed Jan 09, 2008 5:29 pm    Post subject: Reply with quote

OMG!
You are on quite a tear today! Keep em' coming! Very Happy
_________________
.o0[ corey ]0o.
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3959
Location: Pittsburgh

PostPosted: Wed Jan 09, 2008 5:37 pm    Post subject: Reply with quote

Amazing! I cannot try your scripts as fast as you post them. They are real time savers for the rest of us. Thanks, but consider to cut back on coffee: we want you to stay with us for a long time… Wink
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5721

PostPosted: Thu Jan 10, 2008 5:24 am    Post subject: Reply with quote

Many thanks majkinetor. I can now enrich my Appbar to be pro.

When I drag out and release Quick launch from the taskbar I have it floating:



If you have the time and mood, please demonstrate how this can be duplicated ( with tooltips ) with an AHK Gui.

Thanks again. Smile
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2492
Location: Australia, Qld

PostPosted: Thu Jan 10, 2008 9:50 am    Post subject: Reply with quote

Toolbars have some excellent unconventional uses. For example, this is actually a top-level toolbar with a drop-shadow:


(mouse is over button 2)


(button 2 is pressed)

The window has the WS_POPUP, WS_BORDER, TBSTYLE_LIST and CCS_NODIVIDER styles. I sub-classed ToolbarWindow32, mainly to add the CS_DROPSHADOW class style. Smile

I had been writing a toolbar-popup-menu function, but gave up when I realised it would become obsolete when I finally get around to one of my planned projects (layered window system.) I can post the proof-of-concept, if anyone is interested.


@SKAN: iirc, that is done by destroying the toolbar on the taskbar's Rebar control, and recreating it on a floating window. It is a feature of Desk Bands.

You could probably use SetParent to move the toolbar from one GUI to another (i.e. floating tool window.)
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Thu Jan 10, 2008 10:00 am    Post subject: Reply with quote

thx lexikos for idea. Its good to know that menus can be reimplemented that way, I just need to reimplement them. If you remember my PM about menus with titles that stay on the ground, I got a nice idea from ViM editor menus that I will make available in MMenu - First item in ViM menu has small height and you can click it to recrate menu on the desktop. In ViM, they did it using some form of listview, but it seems that "list" toolbar is much better idea.

Anyway, Toolbar module is almost over. The thing that SKAN referes can be done as lexikos said.

But I suggest you to wait until both Toolbar and ReBar modules are over, then you will have some cool things like seveeral toolbars, some to be vertical, etc....

I didn't get tooltips to work yet though, and something that toolbar control supports, moving the buttons around...
_________________
Back to top
View user's profile Send private message MSN Messenger
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Thu Jan 10, 2008 1:36 pm    Post subject: Reply with quote

More serious encapsulation, now in form of includable module. Currently I didn't designed notification interface, so it is hardcoded in module in function Toolbar_onNotify.

To do:
- Arrow buttons (buttons that have small down arrow next to them that can be clicked for list of options)
- Tooltips
- The way to add separators when toolbar is used with image lists.
- Notification interface
_________________
Back to top
View user's profile Send private message MSN Messenger
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Thu Jan 10, 2008 3:01 pm    Post subject: Reply with quote

2Lex
Quote:
I can post the proof-of-concept, if anyone is interested.

About layered windows or about toolbar menu ?

Quote:
You could probably use SetParent to move the toolbar from one GUI to another (i.e. floating tool window.)

By the way, I tried this version with Rebar test and toolbar fails to jump into rebar, it always stay on the parent, for some reason. Adding the toolbar directly to rebar bar instaad gui didn't change anything.... I wonder how it happens to work with arbitrary control or top level window, but it fails with toolbar for some reason. I'll investigate furhter when I "modulize" Rebar.
_________________
Back to top
View user's profile Send private message MSN Messenger
Lexikos



Joined: 17 Oct 2006
Posts: 2492
Location: Australia, Qld

PostPosted: Thu Jan 10, 2008 4:32 pm    Post subject: Reply with quote

majkinetor wrote:
About layered windows or about toolbar menu ?
Toolbar menu. I haven't even started with layered windows. Sad
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Thu Jan 10, 2008 4:36 pm    Post subject: Reply with quote

If you have something I would like to see it.

Thx.
_________________
Back to top
View user's profile Send private message MSN Messenger
SKAN



Joined: 26 Dec 2005
Posts: 5721

PostPosted: Thu Jan 10, 2008 5:03 pm    Post subject: Reply with quote

I will post again after trying. Thanks. Smile
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2492
Location: Australia, Qld

PostPosted: Thu Jan 10, 2008 5:57 pm    Post subject: Reply with quote

Everything I wrote up to the point I scrapped the project: TbMenu-proto.ahk.

Rather than sub-class ToolbarWindow32 directly to add the drop shadow, it probably would have been more appropriate to create a window with a drop shadow to host it. The host window would receive the WM_COMMAND messages for clicking items.
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Fri Jan 11, 2008 9:24 am    Post subject: Reply with quote

Very nice.

You can even make submenus by using dropdown buttons and creating another TBMenu when you recieve such notification.

Do you plan to finish this ? I would be interested to use it.

Its a bit slow, though, even with this small sample menu you created but it shows that it was about SetWinDelay as you resize the main window after every insertion..

BTW, its good to see that you have text bellow buttons in FLAT mode. For some reason, they only appear in my work when I specify LIST style. Do you maybe see where I failed. Our code looks the same with one difference - u used TB_ADDBUTTONSA while I used TB_INSERTBUTTONA (wich doesn't change a thing...).

EDIT: Ah, I see, you add text when creating button, while I add them after... When I add NumPut(&Text, TBB, 16) in my Toolbar_Add function (Text is just empty var) it works correctly. So it seems that I need to do something after changing buttons text if all buttons are originaly added without it. I thought that TB_AUTOSIZE will help. Do you maybe know the way how to show button text bellow the images, if text is not added when button is inserted ?
_________________
Back to top
View user's profile Send private message MSN Messenger
Lexikos



Joined: 17 Oct 2006
Posts: 2492
Location: Australia, Qld

PostPosted: Fri Jan 11, 2008 10:17 am    Post subject: Reply with quote

majkinetor wrote:
Do you plan to finish this ? I would be interested to use it.
No. You may take over, if you'd like.
Quote:
Its a bit slow, though, even with this small sample menu you created but it shows that it was about SetWinDelay as you resize the main window after every insertion..
Perhaps it would help to add some feature for adding multiple buttons simultaneously. TB_ADDBUTTONS' lParam is an array of TBBUTTON, while wParam is the number of buttons in the array. It may also help (in this and other areas) to remove the sub-classed WndProc, since it doesn't actually do anything.
Quote:
I thought that TB_AUTOSIZE will help. Do you maybe know the way how to show button text bellow the images, if text is not added when button is inserted ?
The remarks for TB_AUTOSIZE make it sound like exactly what you want, but I don't recall having any success with it.

There is a button style BTNS_AUTOSIZE, but it seems to apply only to width. I think button height might be defined by the toolbar (i.e. for all buttons.) Try adding one button initially with text and one without. Also try TB_SETBUTTONSIZE.
Quote:
TB_SETBUTTONSIZE should generally be called after adding buttons. This is because in certain toolbar modes the sizes are recalculated when you change things around.
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Fri Jan 11, 2008 12:45 pm    Post subject: Reply with quote

Quote:
Perhaps it would help to add some feature for adding multiple buttons simultaneously. TB_ADDBUTTONS' lParam is an array of TBBUTTON, while wParam is the number of buttons in the array. It may also help (in this and other areas) to remove the sub-classed WndProc, since it doesn't actually do anything.

I was facing the same dilema when implementing this module, but finally realised that speed gain wouldn't be significant (just speculative ofcourse)

Quote:
The remarks for TB_AUTOSIZE make it sound like exactly what you want, but I don't recall having any success with it.

In Toolbar module you first add all buttons you want, then change their states and text afterwards. Without AUTOSIZE, it doesn't look good. I was testing with and without this message.

Quote:
Try adding one button initially with text and one without

If you add single button with text, the space is reserved for all subsequent buttons (didn't check what happened on enventual new rows). I can manage both buttons with text and without but now it can't be switched after toolbar is created (you need to recreate toolbar without text - this doesn't apply to LIST style wich works good in all cases). I remember I tried TB_SETBUTTONSIZE but it just changed the btn size without displaying text again Smile It was in early stage of the module so perhaps I did something wrong, I will recheck.

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

 
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