GaryFrost Posted April 22, 2006 Share Posted April 22, 2006 Gary,Thanks for the user-friendly rgb feature. It fits with my other programs. I've attached an example script that draws 12 buttons.I am unsure why only the first 7 are visible when I run this script.The other 5 buttons appear if you click on their area one at a time.Or all 5 appear if you hit the Tab key.Any ideas? taurus905Nadda, looks like a job for Holger SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
taurus905 Posted April 22, 2006 Share Posted April 22, 2006 (edited) Nadda, looks like a job for HolgerI did find a work-around. (If you can call it that.)Send a Tab and a Shift-Tab after GUISetState()so it looks like this:GUISetState()Send("{TAB}")Send("+{TAB}")Not very elegant, but it works. Edited: I take that back. It doesn't work right.If you minimize the window, the buttons disappear and you need to click or tab each one again in order for them to become visible.taurus905 Edited April 22, 2006 by taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Zedna Posted April 22, 2006 Share Posted April 22, 2006 GUISetState()Send("{TAB}")Send("+{TAB}")Edited: I take that back. It doesn't work right.If you minimize the window, the buttons disappear and you need to click or tab each one again in order for them to become visible.1) try to use some API instead of Send() for example SendMessage Invalidate() for buttons or something similar (InvalidateRect)...2) at minimize/restore problem can help GUIRegisterMsg(WM_DRAW) (or some other?) and do Invalidate for buttons Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
taurus905 Posted April 22, 2006 Share Posted April 22, 2006 I think msgs are being dropped because there is too much code for each msg and the code takes too long to process... But, I could be sooooo wrong.LAr.Larry,I was thinking the same thing. Too long to process. I guess a solution would be to cut down on the code or use some sort of wait feature. Any ideas?taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
taurus905 Posted April 22, 2006 Share Posted April 22, 2006 1) try to use some API instead of Send() for example SendMessage Invalidate() for buttons or something similar (InvalidateRect)...2) at minimize/restore problem can help GUIRegisterMsg(WM_DRAW) (or some other?) and do Invalidate for buttonsZedna,Couldyou provide an example to your suggestions 1 and/or 2?I am not sure what you mean. I think I stayed up too late and I need some more sleep.taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Zedna Posted April 22, 2006 Share Posted April 22, 2006 Zedna,Couldyou provide an example to your suggestions 1 and/or 2?I am not sure what you mean. I think I stayed up too late and I need some more sleep.taurus905I didn't try this toolbar only looked at sources.So it was only ideas for give you a thought about possible ways to solve problems.I can't help more precisely at this time as I do know it exactly myself Maybe somtetimes later when I try it and play with it bit more ... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted April 23, 2006 Share Posted April 23, 2006 Example for Invalidate is in my radar_src.zip, see my signature...$pic_hWnd = ControlGetHandle("Radar","Velikost = ",$pic) DLLCall("user32.dll","int","InvalidateRect","hwnd",$pic_hWnd,"int",0,"int",0); bErase=FalseSo you can this way post InvalidateRect message to these toolbar buttonseither in WM_DRAW or in WM_PAINT function which you register by GUIRegisterMsg()That's my idea Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
taurus905 Posted April 23, 2006 Share Posted April 23, 2006 Example for Invalidate is in my radar_src.zip, see my signature... $pic_hWnd = ControlGetHandle("Radar","Velikost = ",$pic) DLLCall("user32.dll","int","InvalidateRect","hwnd",$pic_hWnd,"int",0,"int",0); bErase=False So you can this way post InvalidateRect message to these toolbar buttons either in WM_DRAW or in WM_PAINT function which you register by GUIRegisterMsg() That's my idea Zedna, Thanks for your input on this problem. It is my hope that your idea can be applied by someone with more knowledge than I possess. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Holger Posted April 23, 2006 Share Posted April 23, 2006 Sorry, it's just the old GUIRegisterMsg()-problem for which I couldn't find any solution yet. Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
Angel Posted April 24, 2006 Share Posted April 24, 2006 But why impliment owner drawn buttons when you can create your own?And why use AutoIt when you can use C++?! :">It is of course a matter of simplicity. I use AutoIt because it usually lets me do a lot of neat stuff with very little effort. If I need to start writing tens of lines of coude just to color a button then the whole purpose of using AutoIt becomes kind of moot...I just believe that this is such a basic thing, used in so many programs that it should either be included as an official UDF or, preferably, as a built-in feature of AutoIt.Angel Link to comment Share on other sites More sharing options...
taurus905 Posted April 27, 2006 Share Posted April 27, 2006 Gary,Thanks for the user-friendly rgb feature. It fits with my other programs. I've attached an example script that draws 12 buttons.I am unsure why only the first 7 are visible when I run this script.The other 5 buttons appear if you click on their area one at a time.Or all 5 appear if you hit the Tab key.Any ideas? taurus905I would really like to do my part in solving this problem, as opposed to just complaining and expecting others to do all the work. I really love AutoIt and feel that by digging deeper I will gain a better understanding in order to help other users. You can't truly help others without helping yourself.Here is my request from advanced users or developers, such as gafrost and Holger, who have both been very helpful already.Can you please suggest areas of study (keywords I can google, or links) that will provide background and possible clues to the hows and whys of setting and changing button colors?At this point, it is my guess that as the 12_button.au3 example stands, that this is a timing issue and may be resolved by some type of delay. It may not be the best solution, but I just want to get it to work first, before tweaking it further.I have some experience with Visual Basic 2005 Express Edition and realize the answer may be a VB issue.Thanks to all who can help point me in the right direction.taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
rakudave Posted May 1, 2006 Share Posted May 1, 2006 my approach on the problem: http://www.autoitscript.com/forum/index.ph...ndpost&p=179113 Pangaea Ruler new, UDF: _GUICtrlCreateContainer(), Pangaea Desktops, Pangaea Notepad, SuDoku, UDF: Table Link to comment Share on other sites More sharing options...
GaryFrost Posted May 1, 2006 Share Posted May 1, 2006 my approach on the problem: http://www.autoitscript.com/forum/index.ph...ndpost&p=179113already know how to treat labels as buttons, what we are looking for is a resolution to the GUIRegisterMsg problem(s) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
jvanegmond Posted June 20, 2006 Share Posted June 20, 2006 (edited) I just make bitmaps all the time. Edited June 20, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
taurus905 Posted June 20, 2006 Share Posted June 20, 2006 I just make bitmaps all the time.Manadar,I too made bitmaps for my buttons. But I would like my flexibility in resizing the buttons and having the color remain across the entire surface. With bitmaps, when you make the button larger the bitmap doesn't grow with it. Plus I would like to use different sizes and types of fonts.I am patiently waiting for Holger and gafrost to work out the GUIRegisterMsg issue. I wish I could help them, but I don't know enough, yet.The colored labels looked good, but didn't work for me because I need a context menu for each button. I was wondering if it were possible to overlay a transparent button on top of a colored label.taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
noonz78 Posted July 25, 2007 Share Posted July 25, 2007 Manadar,I too made bitmaps for my buttons. But I would like my flexibility in resizing the buttons and having the color remain across the entire surface. With bitmaps, when you make the button larger the bitmap doesn't grow with it. Plus I would like to use different sizes and types of fonts.I am patiently waiting for Holger and gafrost to work out the GUIRegisterMsg issue. I wish I could help them, but I don't know enough, yet.The colored labels looked good, but didn't work for me because I need a context menu for each button. I was wondering if it were possible to overlay a transparent button on top of a colored label.taurus905Disclaimer:I have never written anything in AU3 before and I haven't even tried the 12_buttons.au3 demo yet because I can't find some include file GuiButton.au3... However I see that you haved tried to use a bitmat and it rang with something I have ran into before. I have been down that road with my code in the past... My solution then was to make a 2 layer gui. Create the first one with buttons and then make it slightly transparent. Then I would use the same coordinates for everything, but at 100% filled progress bars with he color of my choosing. It worked really great. Then you can just specify width & height for buttons, spacing, the number of buttons, where to break for a new row and set colors for each to automatically generate everything on the fly. I definitely need color buttons to stay focused with my ADHD, so I'll find something that works in AU3. Link to comment Share on other sites More sharing options...
MrCreatoR Posted July 25, 2007 Share Posted July 25, 2007 I definitely need color buttonsThe buttons already can be colored - Just use GuiCtrlSetBkColor()...But the problem with this, is that the buttons are not looks like buttons, they just like label with frame - and i mean they not looks like pushable. Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
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