
Cythor
Members-
Posts
11 -
Joined
-
Last visited
Everything posted by Cythor
-
Very nice clocks guys. I have a another way to calculate the colors for the clock. I use the Bit Operations. I hope it's okay that I used UEZ script as submission. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <Date.au3> $iMargin_X = 10 $iMargin_Y = 10 $iMargin_Inter = 5 $iSize = 50 $iButton_Level = ($iSize * 5) + $iMargin_Inter + 20 $hGUI = GUICreate("Fibonacci Clock", ($iSize * 8) + ($iMargin_X * 2), $iButton_Level + 100) GUISetBkColor(0xC4C4C4) $cBack = GUICtrlCreateLabel("", $iMargin_X - $iMargin_Inter, $iMargin_Y - $iMargin_Inter, _ ($iSize * 8) + ($iMargin_Inter * 2), ($iSize * 5) + $iMargin_Inter) GUICtrlSetBkColor($cBack, 0x000000) $cLabel_1A = GUICtrlCreateLabel("1", $iMargin_X + ($iSize * 2), $iMargin_Y, $iSize - $iMargin_Inter, $iSize - $iMargin_Inter) $cLabel_1B = GUICtrlCreateLabel("1", $iMargin_X + ($iSize * 2), $iMargin_Y + $iSize, $iSize - $iMargin_Inter, $iSize - $iMargin_Inter) $cLabel_2 = GUICtrlCreateLabel("2", $iMargin_X, $iMargin_Y, ($iSize * 2) - $iMargin_Inter, ($iSize * 2) - $iMargin_Inter) $cLabel_3 = GUICtrlCreateLabel("3", $iMargin_X, $iMargin_Y + ($iSize * 2), ($iSize * 3) - $iMargin_Inter, ($iSize * 3) - $iMargin_Inter) $cLabel_5 = GUICtrlCreateLabel("5", $iMargin_X + ($iSize * 3), $iMargin_Y, $iSize * 5, ($iSize * 5) - $iMargin_Inter) $cUserSet = GUICtrlCreateButton("Set User Time", $iMargin_X, $iButton_Level, 100, 30) $cUserHour = GUICtrlCreateCombo("", $iMargin_X + 120, $iButton_Level, 40, 20) GUICtrlSetData($cUserHour, "00|01|02|03|04|05|06|07|08|09|10|11|12") $cUserMin = GUICtrlCreateCombo("", $iMargin_X + 160, $iButton_Level, 40, 20) GUICtrlSetData($cUserMin, "00|05|10|15|20|25|30|35|40|45|50|55") $cReset = GUICtrlCreateButton("Reset Current Time", $iMargin_X, $iButton_Level + 50, 120, 30) GUICtrlCreateLabel("Hours:" & @CRLF & @CRLF & "Mins:" & @CRLF & @CRLF & "Both:", 250, $iButton_Level, 150, 80) GUICtrlCreateLabel("", 300, $iButton_Level, 50, 20) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlCreateLabel("", 300, $iButton_Level + 25, 50, 20) GUICtrlSetBkColor(-1, 0x00FF00) GUICtrlCreateLabel("", 300, $iButton_Level + 50, 50, 20) GUICtrlSetBkColor(-1, 0x0000FF) GUISetState() _Reset() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cReset _Reset() Case $cUserSet $iHour = GUICtrlRead($cUserHour) $iMin = GUICtrlRead($cUserMin) _Set_Clock($iHour, $iMin) EndSwitch WEnd Func _Reset() $sDTG = _NowCalc() $iHour = StringRegExpReplace($sDTG, "^.*\s(\d\d):.*", "$1") $iMin = StringRegExpReplace($sDTG, "^.*:(\d\d):.*", "$1") _Set_Clock($iHour, $iMin) EndFunc ;==>_Reset Func _Set_Clock($iH, $iM) Local Static $aiColor[4] = [0xC4C4C4, 0x00FF00, 0xFF0000, 0x0000FF] Local $iColor = _FibColor($iH, $iM) GUICtrlSetBkColor($cLabel_1B, $aiColor[BitAND($iColor, 3)]) GUICtrlSetBkColor($cLabel_1A, $aiColor[BitShift(BitAND($iColor, 12), 2)]) GUICtrlSetBkColor($cLabel_2, $aiColor[BitShift(BitAND($iColor, 48), 4)]) GUICtrlSetBkColor($cLabel_3, $aiColor[BitShift(BitAND($iColor, 192), 6)]) GUICtrlSetBkColor($cLabel_5, $aiColor[BitShift(BitAND($iColor, 768), 8)]) EndFunc ;==>_Set_Clock Func _FibColor($iHour, $iMin) Return BitOR(BitShift(BitOR(BitShift(BitOR(BitShift(BitOR(BitShift(BitOR(BitShift(BitAND(_DecToFib(Mod($iHour, 13)), 16) And True, -2), BitAND(_DecToFib(Mod($iHour, 13)), 8) And True), -2), BitAND(_DecToFib(Mod($iHour, 13)), 4) And True), -2), BitAND(_DecToFib(Mod($iHour, 13)), 2) And True), -2), BitAND(_DecToFib(Mod($iHour, 13)), 1) And True), -1), BitOR(BitShift(BitOR(BitShift(BitOR(BitShift(BitOR(BitShift(BitAND(_DecToFib(Mod(Ceiling($iMin / 5), 12)), 16) And True, -2), BitAND(_DecToFib(Mod(Ceiling($iMin / 5), 12)), 8) And True), -2), BitAND(_DecToFib(Mod(Ceiling($iMin / 5), 12)), 4) And True), -2), BitAND(_DecToFib(Mod(Ceiling($iMin / 5), 12)), 2) And True), -2), BitAND(_DecToFib(Mod(Ceiling($iMin / 5), 12)), 1) And True)) EndFunc ;==>_FibColor Func _DecToFib($iNum) Return BitOR(BitShift(BitOR(BitShift(BitOR(BitShift(BitOR(BitShift((BitAND($iNum, 4) And BitAND($iNum, 1)) Or (BitAND($iNum, 4) And BitAND($iNum, 2)) Or BitAND($iNum, 8), -1), (BitAND($iNum, 4) And Not BitAND($iNum, 2) And Not BitAND($iNum, 1)) Or BitAND($iNum, 8)), -1), (Not BitAND($iNum, 4) And BitAND($iNum, 2)) Or (BitAND($iNum, 2) And BitAND($iNum, 1)) Or (BitAND($iNum, 8) And BitAND($iNum, 4))), -1), (Not BitAND($iNum, 4) And BitAND($iNum, 1)) Or (BitAND($iNum, 4) And Not BitAND($iNum, 1))), -1), BitAND($iNum, 8) And BitAND($iNum, 4)) EndFunc ;==>_DecToFib Cythor
-
Sorry guys, but I don't know where I can post my Problem. The BugTracker tell me: What can I do now? I want to report this: In the AutoItConstants.au3 File are all Mouse Constants ($IDC_XXX >> Line 72 to 88) wrong. MSDN >> [http://msdn.microsoft.com/en-us/library/windows/desktop/ms648391(v=vs.85).aspx] << Code with Error: {{{ #include <WinAPIRes.au3> $hCursor = _WinAPI_LoadCursor(Null, $IDC_ARROW) ConsoleWrite(@CRLF & '+ Handle: ' & $hCursor & @CRLF & _ '! Error : ' & _WinAPI_GetLastError() & @CRLF & @CRLF) }}} The Error Code is 1813. MSDN says: "The specified resource type cannot be found in the image file." >> [http://msdn.microsoft.com/en-us/library/windows/desktop/ms681386(v=vs.85).aspx] << Here are the right constants: {{{ ;~ Global Const $IDC_UNKNOWN = 0 ; Unknown cursor Global Const $IDC_APPSTARTING = 32650 ; Standard arrow and small hourglass Global Const $IDC_ARROW = 32512 ; Standard arrow Global Const $IDC_CROSS = 32515 ; Crosshair Global Const $IDC_HAND = 32649 ; Hand cursor Global Const $IDC_HELP = 32651 ; Arrow and question mark Global Const $IDC_IBEAM = 32513 ; I-beam Global Const $IDC_ICON = 32641 ; Obsolete Global Const $IDC_NO = 32648 ; Slashed circle Global Const $IDC_SIZE = 32640 ; Obsolete Global Const $IDC_SIZEALL = 32646 ; Four-pointed arrow pointing N, S, E, and W Global Const $IDC_SIZENESW = 32643 ; Double-pointed arrow pointing NE and SW Global Const $IDC_SIZENS = 32645 ; Double-pointed arrow pointing N and S Global Const $IDC_SIZENWSE = 32642 ; Double-pointed arrow pointing NW and SE Global Const $IDC_SIZEWE = 32644 ; Double-pointed arrow pointing W and E Global Const $IDC_UPARROW = 32516 ; Vertical arrow Global Const $IDC_WAIT = 32514 ; Hourglass }}} The $IDC_UNKNOWN constant doesn't exist: {{{ #include <WinAPIRes.au3> $hCursor = _WinAPI_LoadCursor(Null, $IDC_UNKNOWN) ConsoleWrite(@CRLF & '+ Handle: ' & $hCursor & @CRLF & _ '! Error : ' & _WinAPI_GetLastError() & @CRLF & @CRLF) }}} Sorry, my english ist bad ^^
-
Smart 8| Thank you very much for the code. I will write the Line Numbers left of the Edit Control. But the GUI is to little for long texts. The rest can I do alone. Cythor =D
-
Hello people. I need the Line Number of the Cursor in a Edit Control. But I haven't a idea how I can do that. I need a idea or a beginning for my problem. I hope you can help me. Cythor =)
-
Oh Thank you
-
Hello guys! I have a problem with a Menu. I need submenus under the Menu Items. But I can't find a instruction for that. Here is my Script: #include <GUIConstants.au3> #include <GuiMenu.au3> #include <WindowsConstants.au3> Opt('GUICloseOnESC', 0) Opt('GUIOnEventMode', 1) Opt('GUIResizeMode', $GUI_DOCKALL) ; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ + $hGUI = GUICreate('', 1006, 618, -1, -1, $WS_BORDER + $WS_MAXIMIZEBOX + $WS_MINIMIZEBOX + $WS_SIZEBOX + $WS_SYSMENU) ; Menü $hMenu = _GUICtrlMenu_CreateMenu() $idMenuFile = _GUICtrlMenu_AddMenuItem($hMenu, 'File') $idMenuEdit = _GUICtrlMenu_AddMenuItem($hMenu, 'Edit') $idMenuProject = _GUICtrlMenu_AddMenuItem($hMenu, 'Project') $idMenuTool = _GUICtrlMenu_AddMenuItem($hMenu, 'Tools') _GUICtrlMenu_SetMenu($hGUI, $hMenu) GUISetOnEvent($GUI_EVENT_CLOSE, 'GUI_EVENT_CLOSE') GUISetState() ; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ + While Sleep(1000) WEnd ; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ + Func GUI_EVENT_CLOSE() Exit EndFunc I hope you can help me. Cythor
-
Controls created on another window
Cythor replied to Cythor's topic in AutoIt General Help and Support
I have a new question: I want to create a graphic control to another window. But I can not find this function. GUICtrlCreateGraphic() I need this for an own created button. -
Controls created on another window
Cythor replied to Cythor's topic in AutoIt General Help and Support
Ah, okey Thank you ^^ -
First: My english is not good. Sorry I have a Question: Is it possible a control on another window to created? When yes -> How does it work? Cythor
-
Thank you
-
Sorry, my English is bad: I press Ctrl + 1 in the SciTE. Now a window open. In the Window is a Text: Group: General settings Keep n BAK versions of the edited file (0=None) I can't the value change. In the moment is the value 5. But I want change the value to 0. After I changed the value to 0, I press on Save+Apply. If I restart my SciTE, the value is back to 5. It always arise .bak files. that's irritating... Thanks for helpers.