Siwa Posted November 4, 2020 Posted November 4, 2020 Hello autoit community, I want to execute a function when the combo box down arrow in clicked. I don't want it to show the dropdown list at all. I searched the forum, but I did not find any suitable source to work on. I just want to show some text as the current date inside the combo box, and then when the dropdown arrow is pressed, I want it to show another GUI. I have created my own Data Picker calendar with JavaScript, and I want it to be displayed when the down arrow is clicked. Is there a possibility perform this action ?
Nine Posted November 4, 2020 Posted November 4, 2020 53 minutes ago, Siwa said: I don't want it to show the dropdown list at all Isn't that an abnormal behavior for a Windows control ? Why don't you simply use a Label box or something more appropriate ? Just asking... Siwa 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
Siwa Posted November 4, 2020 Author Posted November 4, 2020 I know it is odd for the controller, but I want to display it as an input box for a data picker GUI. Is there anyway other way you can think of ?
Nine Posted November 4, 2020 Posted November 4, 2020 Maybe show your script, it would be easier to have some code to test and understand your issue... Siwa 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
Siwa Posted November 4, 2020 Author Posted November 4, 2020 expandcollapse popup#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <IE.au3> #include <WinAPI.au3> #Include <Misc.au3> #include <Date.au3> Global $Persian_JS_Date Local $hDLL = DllOpen("user32.dll") Local $AlphaKey = 1 ; the transparent color of your choice $Main_GUI = GUICreate(550,500) $Show_Calendar = GUICtrlCreateButton("Show Calendar",350,150,100,50) $Combo_Box = GUICtrlCreateCombo(_NowDate ( ),350,250,100,50) $Date_GUI = GUICreate("Persian Calendar", 330, 255, -1, -1, $WS_POPUP+$WS_CLIPCHILDREN, $WS_EX_LAYERED) GUISetBkColor($AlphaKey, $Date_GUI) _WinAPI_SetLayeredWindowAttributes($Date_GUI, $AlphaKey , 0, $LWA_COLORKEY) $Persian_Date_IE = _IECreateEmbedded() $Persian_Calendar_Obect = GUICtrlCreateObj($Persian_Date_IE, -20, -63, 1000, 1000) _IENavigate($Persian_Date_IE, @ScriptDir & "\ShamsiCalendar\jalali.html") $Persian_Date_IE.document.body.style.backgroundColor = $AlphaKey GUISetState(@SW_SHOW,$Main_GUI) $Date_GUI_Close = GUICreate("Persian Calendar Close",200,200, 50, 24,$WS_POPUP+$WS_CLIPSIBLINGS ,$WS_EX_LAYERED,$Date_GUI) GUISetBkColor($AlphaKey, $Date_GUI_Close) GUISwitch($Date_GUI_Close) _WinAPI_SetLayeredWindowAttributes($Date_GUI_Close, $AlphaKey , 0, $LWA_COLORKEY) $Exit_Button_Calendar_GUI = GUICtrlCreateButton("Close", 0, 0, 50, 24) While 1 GUISwitch($Date_GUI) $msg = GUIGetMsg() Switch $msg Case $Exit_Button_Calendar_GUI GUISetState(@SW_HIDE,$Date_GUI) GUISetState(@SW_HIDE,$Date_GUI_Close) GUISwitch($Main_GUI) Case $Show_Calendar GUISetState(@SW_SHOW,$Date_GUI) GUISetState(@SW_SHOW,$Date_GUI_Close) Case $GUI_EVENT_CLOSE Exit EndSwitch $Persian_JS_Date = 0 $nLeftclicks = 0 If _IsPressed("01", $hDLL) Then ;If left mouse button pressed $Pos = MouseGetPos() ;Get mouse position Do While (_IsPressed("01", $hDLL)) ;Wait until user releases button Sleep(10) WEnd $nLeftclicks += 1 ;Increment click count sleep(100) ;Wait for 100ms $aTemp = MouseGetPos() ;Get new mouse position again Until(Not ($aTemp[0] = $Pos[0] and $aTemp[1] = $Pos[1] and _IsPressed("01", $hDLL))) ;Loop until mouse is on a new position or it is not pushed again EndIf If $nLeftclicks = "2" and $Persian_Date_IE.document.getElementById('display_area_1').innertext<> "1399" Then $Persian_JS_Date = $Persian_Date_IE.document.getElementById('display_area_1').innertext $cDate = $Persian_JS_Date MsgBox(0,"",$cDate) $Persian_Date_IE.document.getElementById('display_area_1').innertext = '1399'; GUISetState(@SW_HIDE,$Date_GUI) Exit EndIf $winpos = WinGetPos($Date_GUI) WinMove("Persian Calendar Close", "", $winpos[0] + $winpos[2], $winpos[1]) WEnd Sorry for the mess, it is a part of another log code. I want to show the GUI when the down arrow of the combo box is clicked instead of the button.
Nine Posted November 4, 2020 Posted November 4, 2020 We would need the html file too. Siwa 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
Nine Posted November 4, 2020 Posted November 4, 2020 It doesn't work well for me. Calendar is cropped and overlaps other controls. But this is not important for your issue. I would think that my first impression of using a label box would work far better than a pseudo-combo-box. expandcollapse popup#include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <IE.au3> #include <WinAPI.au3> #include <Misc.au3> #include <Date.au3> Global $Persian_JS_Date Local $hDLL = DllOpen("user32.dll") Local $AlphaKey = 0xFFFF00 ; the transparent color of your choice $Main_GUI = GUICreate("", 550, 500) $Show_Calendar = GUICtrlCreateButton("Show Calendar", 350, 150, 100, 50) $idBox = GUICtrlCreateLabel(_NowDate(), 350, 250, 100, 50, $SS_SUNKEN + $SS_CENTER + $SS_CENTERIMAGE) $Date_GUI = GUICreate("Persian Calendar", 330, 255, -1, -1, $WS_POPUP + $WS_CLIPCHILDREN, $WS_EX_LAYERED) GUISetBkColor($AlphaKey, $Date_GUI) _WinAPI_SetLayeredWindowAttributes($Date_GUI, $AlphaKey, 0, $LWA_COLORKEY) $Persian_Date_IE = _IECreateEmbedded() $Persian_Calendar_Obect = GUICtrlCreateObj($Persian_Date_IE, -20, -63, 1000, 1000) _IENavigate($Persian_Date_IE, @ScriptDir & "\jalali.html") $Persian_Date_IE.document.body.style.backgroundColor = $AlphaKey GUISetState(@SW_SHOW, $Main_GUI) $Date_GUI_Close = GUICreate("Persian Calendar Close", 200, 200, 50, 24, $WS_POPUP + $WS_CLIPSIBLINGS, $WS_EX_LAYERED, $Date_GUI) GUISetBkColor($AlphaKey, $Date_GUI_Close) GUISwitch($Date_GUI_Close) _WinAPI_SetLayeredWindowAttributes($Date_GUI_Close, $AlphaKey, 0, $LWA_COLORKEY) $Exit_Button_Calendar_GUI = GUICtrlCreateButton("Close", 0, 0, 50, 24) While 1 GUISwitch($Date_GUI) $msg = GUIGetMsg() Switch $msg Case $Exit_Button_Calendar_GUI GUISetState(@SW_HIDE, $Date_GUI) GUISetState(@SW_HIDE, $Date_GUI_Close) GUISwitch($Main_GUI) Case $Show_Calendar GUISetState(@SW_SHOW, $Date_GUI) GUISetState(@SW_SHOW, $Date_GUI_Close) Case $GUI_EVENT_CLOSE Exit Case $idBox ConsoleWrite("Box has been clicked" & @CRLF) ; do your stuff here EndSwitch $Persian_JS_Date = 0 $nLeftclicks = 0 If _IsPressed("01", $hDLL) Then ;If left mouse button pressed $Pos = MouseGetPos() ;Get mouse position Do While (_IsPressed("01", $hDLL)) ;Wait until user releases button Sleep(10) WEnd $nLeftclicks += 1 ;Increment click count Sleep(100) ;Wait for 100ms $aTemp = MouseGetPos() ;Get new mouse position again Until (Not ($aTemp[0] = $Pos[0] And $aTemp[1] = $Pos[1] And _IsPressed("01", $hDLL))) ;Loop until mouse is on a new position or it is not pushed again EndIf If $nLeftclicks = "2" And $Persian_Date_IE.document.getElementById('display_area_1').innertext <> "1399" Then $Persian_JS_Date = $Persian_Date_IE.document.getElementById('display_area_1').innertext $cDate = $Persian_JS_Date MsgBox(0, "", $cDate) $Persian_Date_IE.document.getElementById('display_area_1').innertext = '1399' ; GUISetState(@SW_HIDE, $Date_GUI) Exit EndIf $winpos = WinGetPos($Date_GUI) WinMove("Persian Calendar Close", "", $winpos[0] + $winpos[2], $winpos[1]) WEnd Also I would personally write an autoit calendar instead of using the JS code. Siwa 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
Siwa Posted November 4, 2020 Author Posted November 4, 2020 I tried too, even created another topic but no one helped unfortunately. I'll apricate it if you can put me in the right direction, how to create my own calendar.
Nine Posted November 4, 2020 Posted November 4, 2020 I recently created a calendar with small effort, I know it is not perfect for you but I suppose it can get you a start up : The displayed picture is now wrong but I do not have the ability to change it. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
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