Jikoo Posted October 27, 2008 Share Posted October 27, 2008 (edited) Hello, Could you tell me why, when I click on a button, the transmitted color is not the same. It work well on the first and the last one but not on the second and the third. Click on a button to see. Thank you. expandcollapse popup#include <GUIConstants.au3> #include <Misc.au3> Opt('MustDeclareVars', 1) Local $msg, $hGUI Local $buttonColor1, $buttonColor2, $buttonColor3, $buttonColor4 Local $color1 = 0xF000FF Local $color2 = 0x9999CC Local $color3 = 0xAA0000 Local $color4 = 0xAC00A9 $hGUI = GUICreate("Choose Color Hex", 200, 300) $buttonColor1 = GUICtrlCreateButton("0x" & Hex($color1, 6), 20, 20, 100, 40) GUICtrlSetBkColor(-1, $color1) $buttonColor2 = GUICtrlCreateButton("0x" & Hex($color2, 6), 20, 70, 100, 40) GUICtrlSetBkColor(-1, $color2) $buttonColor3 = GUICtrlCreateButton("0x" & Hex($color3, 6), 20, 120, 100, 40) GUICtrlSetBkColor(-1, $color3) $buttonColor4 = GUICtrlCreateButton("0x" & Hex($color4, 6), 20, 170, 100, 40) GUICtrlSetBkColor(-1, $color4) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $buttonColor1 _ChooseColor(2, $color1, 0) Case $buttonColor2 _ChooseColor(2, $color2, 0) Case $buttonColor3 _ChooseColor(2, $color3, 0) Case $buttonColor4 _ChooseColor(2, $color4, 0) EndSwitch WEnd Edited October 29, 2008 by Jikoo My projects : GCS Search 1.07 (GUI Control Styles Search)* Multilingual tool to help about the old scripts, with a dynamic menu.* Easy way to find missing Include files in old scripts downloaded from forums !* Famous Monoceres script added and improved (visual, drag and drop, automatic)* There is an interactive color converter with palettes too, for fun !The best way to start Autoit3 development (for newbies). Link to comment Share on other sites More sharing options...
Andreik Posted October 27, 2008 Share Posted October 27, 2008 Hello, Could you tell me why, when I click on a button, the transmitted color is not the same. It work well on the first and the last one but not on the second and the third. Click on a button to see. Thank you. expandcollapse popup#include <GUIConstants.au3> #include <Misc.au3> Opt('MustDeclareVars', 1) Local $msg, $hGUI Local $buttonColor1, $buttonColor2, $buttonColor3, $buttonColor4 Local $color1 = 0xF000FF Local $color2 = 0x9999CC Local $color3 = 0xAA0000 Local $color4 = 0xAC00A9 $hGUI = GUICreate("Choose Color Hex", 200, 300) $buttonColor1 = GUICtrlCreateButton("0x" & Hex($color1, 6), 20, 20, 100, 40) GUICtrlSetBkColor(-1, $color1) $buttonColor2 = GUICtrlCreateButton("0x" & Hex($color2, 6), 20, 70, 100, 40) GUICtrlSetBkColor(-1, $color2) $buttonColor3 = GUICtrlCreateButton("0x" & Hex($color3, 6), 20, 120, 100, 40) GUICtrlSetBkColor(-1, $color3) $buttonColor4 = GUICtrlCreateButton("0x" & Hex($color4, 6), 20, 170, 100, 40) GUICtrlSetBkColor(-1, $color4) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $buttonColor1 _ChooseColor(2, $color1, 0) Case $buttonColor2 _ChooseColor(2, $color2, 0) Case $buttonColor3 _ChooseColor(2, $color3, 0) Case $buttonColor4 _ChooseColor(2, $color4, 0) EndSwitch WEnd expandcollapse popup#include <GUIConstants.au3> #include <Misc.au3> Opt('MustDeclareVars', 1) Local $msg, $hGUI Local $buttonColor1, $buttonColor2, $buttonColor3, $buttonColor4 Local $color1 = 0xF000FF Local $color2 = 0x9999CC Local $color3 = 0xAA0000 Local $color4 = 0xAC00A9 $hGUI = GUICreate("Choose Color Hex", 200, 300) $buttonColor1 = GUICtrlCreateButton("0x" & Hex($color1, 6), 20, 20, 100, 40) GUICtrlSetBkColor(-1, $color1) $buttonColor2 = GUICtrlCreateButton("0x" & Hex($color2, 6), 20, 70, 100, 40) GUICtrlSetBkColor(-1, $color2) $buttonColor3 = GUICtrlCreateButton("0x" & Hex($color3, 6), 20, 120, 100, 40) GUICtrlSetBkColor(-1, $color3) $buttonColor4 = GUICtrlCreateButton("0x" & Hex($color4, 6), 20, 170, 100, 40) GUICtrlSetBkColor(-1, $color4) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $buttonColor1 _ChooseColor(2, $color1, 2) Case $buttonColor2 _ChooseColor(2, $color2, 2) Case $buttonColor3 _ChooseColor(2, $color3, 2) Case $buttonColor4 _ChooseColor(2, $color4, 2) EndSwitch WEnd When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Jikoo Posted October 27, 2008 Author Share Posted October 27, 2008 Thanks a lot Andreik, I understood. It was the RGB mode. From help AutoIt : $iRefType Type of $iColorRef passed in, valid values: 0 - COLORREF rgbcolor 1 - BGR hex 2 - RGB hex My projects : GCS Search 1.07 (GUI Control Styles Search)* Multilingual tool to help about the old scripts, with a dynamic menu.* Easy way to find missing Include files in old scripts downloaded from forums !* Famous Monoceres script added and improved (visual, drag and drop, automatic)* There is an interactive color converter with palettes too, for fun !The best way to start Autoit3 development (for newbies). Link to comment Share on other sites More sharing options...
Andreik Posted October 27, 2008 Share Posted October 27, 2008 Thanks a lot Andreik, I understood. It was the RGB mode.From help AutoIt :$iRefType Type of $iColorRef passed in, valid values: 0 - COLORREF rgbcolor 1 - BGR hex 2 - RGB hexYes. $iColorRef type in your case was RGB Hex. When the words fail... music speaks. 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