Madza91 Posted September 14, 2008 Posted September 14, 2008 (edited) Don't forget $NM_CLICK, if you want to use Mouse UP Func _TB_WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) Local $NMMOUSE = DllStructCreate("hwnd hWndFrom;int IDFrom;int Code;ulong_ptr dwItemSpec;ulong_ptr dwItemData;int pt[2]; ulong_ptr dwHitInfo;", $lParam) ;~ ConsoleWrite(DllStructGetData($NMMOUSE,1) & @CRLF) If DllStructGetData($NMMOUSE, 1) = $hToolbar Then If DllStructGetData($NMMOUSE, 3) = $NM_CLICK Then ; Here you can add the commands :) I made an extra Func, which is called with a Dummy -> This Func doens't wait;) Local $ClickedButtonID = DllStructGetData($NMMOUSE, "dwItemSpec") GUICtrlSendToDummy($ToolbarBUTTONDummy, $ClickedButtonID) EndIf EndIf Return 'GUI_RUNDEFMSG' EndFunc;==>_TB_WM_NOTIFY This is very easiest but without button tips... how to add it ? Edited September 14, 2008 by n3nE [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
rover Posted September 14, 2008 Posted September 14, 2008 How to use this "easiest way" in this example with custom icons ^^ ? Because with rover's way when push down mouse click and move cursor to not be over button func will be called anyway... sry for bad english just use the previous WM_NOTIFY handler and replace $TBN_ENDDRAG with $NM_CLICKProgAndy posted a condensed version of the same thing in Garys/my exampleyou will want to use a dummy control for the passing button clicks to functions,look at the post I linked to in the above message for the dropdown button. I see fascists...
Madza91 Posted September 14, 2008 Posted September 14, 2008 Thank you one more timeeeee [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
rover Posted September 14, 2008 Posted September 14, 2008 Thank you one more timeeeee >_<no problem n3nE I see fascists...
rover Posted September 15, 2008 Posted September 15, 2008 @n3nE one more thing a database program I use always has the thin vertical line between toolbar button groupings regardless of visual style. so it looks like it is a visual styles issue as I mentioned. I tried the XPStyle() UDF on the toolbar. you get those vertical lines with a 1 pixel separator as you asked. Control XP Style for Colors usage CODEGlobal $XS_n ; var needed for restoring visual style XPStyle(1) _GUICtrlToolBar_Create() XPStyle(0) I see fascists...
ProgAndy Posted September 15, 2008 Posted September 15, 2008 (edited) I mean on line between buttons like this:You do it this way:_GUICtrlToolbar_AddButton($hToolbar,0,6,0,BitOR($BTNS_DROPDOWN,$BTNS_SEP))the 6 in case of the Bitmap is the width of the separator. To see the line, it must be >= 6 To show the line, I added the style $BTNS_DROPDOWN, like descripbed in http://www.winehq.org/pipermail/wine-patch...ary/009612.html Edited September 15, 2008 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
rover Posted September 15, 2008 Posted September 15, 2008 (edited) You do it this way: _GUICtrlToolbar_AddButton($hToolbar,0,6,0,BitOR($BTNS_DROPDOWN,$BTNS_SEP)) the 6 in case of the Bitmap is the width of the separator. To see the line, it must be >= 6 To show the line, I added the style $BTNS_DROPDOWN, like descripbed in http://www.winehq.org/pipermail/wine-patch...ary/009612.html ProgAndy yes I know that the default value for the separator button alias _GUICtrlToolbar_AddButtonSep() is 6 pixels Is there some combination of styles for _GUICtrlToolbar_Create() you are using? I can't get a thin line between the buttons with the addition of the $BTNS_DROPDOWN style to the alias _GUICtrlToolbar_AddButtonSep() or _GUICtrlToolbar_AddButton () as you show. the separator appears the same with or without adding the $BTNS_DROPDOWN style. only as space between buttons, no visible lines tested on two XP machines with different visual styles. I do get the thin line with XPStyle() as shown in two visual styles Edit: BTW, I'll take this opportunity to thank you for all the great code you have posted >_< expandcollapse popup#include <GuiToolbar.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> Opt('MustDeclareVars', 1) Global $XS_n ; var needed for restoring visual style _Main() Func _Main() Local $hGUI, $hToolbar Local Enum $idNew = 1000, $idOpen, $idSave, $idHelp $hGUI = GUICreate("Toolbar", 400, 300) ;XPStyle(1) $hToolbar = _GUICtrlToolbar_Create($hGUI) ;XPStyle(0) GUISetState() _GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR) _GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW) _GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN) _GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE) _GUICtrlToolbar_AddButton($hToolbar, 0, 6, 0, BitOR($BTNS_DROPDOWN, $BTNS_SEP)) _GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main Func XPStyle($OnOff = 1) If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc ;==>XPStyle Edited September 15, 2008 by rover I see fascists...
Madza91 Posted September 21, 2008 Posted September 21, 2008 (edited) ProgAndy, not working for me, only works when made toolbar without any 'styles'... (_GUICtrlToolbar_Create($hGUI)) Edited September 22, 2008 by n3nE [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
ProgAndy Posted September 22, 2008 Posted September 22, 2008 OK, if you use styles, you need $TBSTYLE_FLAT ( at least in my code. Works NOT woth Global $hToolbar = _GUICtrlToolbar_Create($Gui,BitOR($WS_CHILD, $WS_CLIPSIBLINGS, $WS_VISIBLE,$TBSTYLE_TOOLTIPS)) But works with Global $hToolbar = _GUICtrlToolbar_Create($Gui);,BitOR($WS_CHILD, $WS_CLIPSIBLINGS, $WS_VISIBLE,$TBSTYLE_TOOLTIPS,$TBSTYLE_FLAT)) *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Madza91 Posted September 22, 2008 Posted September 22, 2008 Now works. [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
rover Posted September 25, 2008 Posted September 25, 2008 had another look at this and found the problem for me with the toolbar separator and invisible line I use a modified uxtheme.dll to allow me to use old longhorn, vista and third party themes using the default XP Luna etc themes loaded from the display properties theme tab I get the dividing line, but not with many visual styles other than those included with XP and loaded from the appearance tab of display properties. first time around I tried Luna theme instead of the SlateXP theme I was using but I didn't get the line. don't know what went wrong there, but trying theme/visual style changing again I finally got the line. as an example, Mozilla Thunderbird's toolbar always has the separators with a dividing line regardless of visual style but script toolbar examples lose the dividing line with many of my visual styles. eg. (a script toolbar loses the separator line with SlateXP visual style but not with Pantherg, Thunderbird not affected, line always displayed) Thunderbird may be using .NET or some other toolbar library. however Firefox's toolbar will lose the separator lines with styles like SlateXP using _GUICtrlToolbar_Create() with or without styles had no effect on the separator line. I see fascists...
Madza91 Posted November 7, 2008 Posted November 7, 2008 (edited) Just one thing, when I made Toolbar on 'normal' GUI, and maximize it, i get this Bugged line on top of GUI... See pic: Edited November 7, 2008 by n3nE [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
ProgAndy Posted November 7, 2008 Posted November 7, 2008 you can avoid this, wehen calling _GUICtrlToolbar_SetStyleFlat($hToolbar, 1) on $GUI_EVENT_RESIZE *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Madza91 Posted November 7, 2008 Posted November 7, 2008 $GUI_EVENT_RESIZE ? That doesn't work, but $GUI_EVENT_MAXIMIZE works ;d [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
ProgAndy Posted November 7, 2008 Posted November 7, 2008 you're right. event_resize is needed, when enable size borders ... *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Madza91 Posted November 7, 2008 Posted November 7, 2008 Yes... ^^ WARNING: $GUI_EVENT_RESIZE: possibly used before declaration. [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
ProgAndy Posted November 7, 2008 Posted November 7, 2008 (edited) last post to this topic... wrote too fast, needs to be $GUI_EVENT_RESIZED Edited November 7, 2008 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Madza91 Posted November 7, 2008 Posted November 7, 2008 Oh yes, ...resized Works now, but event_resized send notification only when is END of resizing... but never mind, thx ;D [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now