Mateo Posted January 20, 2021 Share Posted January 20, 2021 I have a GUI set to RTL, and I want to create a certain input that will be ltr. Is there such an option? (I do not want with $WS_EX_CLIENTEDGE) Thank you. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 20, 2021 Moderators Share Posted January 20, 2021 Mateo, I did this a while ago: M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Mateo Posted January 20, 2021 Author Share Posted January 20, 2021 This is a "patch" solution, isn't there something that works better? (I mean, it does not solve the problem itself) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 20, 2021 Moderators Share Posted January 20, 2021 Mateo, Quote isn't there something that works better? Not exactly fulsome in your thanks, are you? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
pixelsearch Posted January 21, 2021 Share Posted January 21, 2021 (edited) 19 hours ago, Mateo said: I have a GUI set to RTL, and I want to create a certain input that will be ltr. A simple way to do it : #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $hGui = GUICreate("", 260, 100, -1, -1, -1, BitOr($WS_EX_LAYOUTRTL, $WS_EX_NOINHERITLAYOUT)) GUICtrlCreateLabel("Username", 15, 15, 80, 20, $SS_RIGHT) $id_Username = GUICtrlCreateInput("", 80, 10, 100, 20) ; LTR ; $id_Username = GUICtrlCreateInput("", 80, 10, 100, 20, BitOr($ES_RIGHT, $ES_AUTOHSCROLL)) ; RTL $id_OK = GUICtrlCreateButton("OK", 190, 10, 60, 50) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $id_OK GUIDelete($hGui) ExitLoop EndSwitch WEnd Edit: added syntax for both kind of Input controls (LTR or RTL), also added $SS_RIGHT for the label control. Edited January 21, 2021 by pixelsearch Melba23 1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 21, 2021 Moderators Share Posted January 21, 2021 pixelsearch, Excellent work! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
pixelsearch Posted January 21, 2021 Share Posted January 21, 2021 Thank you @Melba23 I was lucky trying the extended style $WS_EX_NOINHERITLAYOUT ("The window does not pass its window layout to its child windows") and it worked Link to comment Share on other sites More sharing options...
pixelsearch Posted January 21, 2021 Share Posted January 21, 2021 (edited) Tests show that OP will have a little problem, because probably all his Input controls are already RTL and he wants to add now an LTR input control. So changing the extended style of his RTL GUI from $WS_EX_LAYOUTRTL to BitOr($WS_EX_LAYOUTRTL, $WS_EX_NOINHERITLAYOUT) will solve his LTR issue... but will create some issues in his RTL Input and RTL Label controls which are already designed. Though I indicated a possible syntax to use them in the precedent script ($SS_RIGHT for labels, BitOr($ES_RIGHT, $ES_AUTOHSCROLL) for RTL input controls), little issues may still be annoying (bad cursor position while filling RTL input controls, Del and Backspace keys will be a bit hard to handle) If there is only one LTR input control and many RTL input controls in his RTL Gui, then the following script may be more useful, because OP will be allowed to fill his LTR input control (please note the position of the cursor while it is filled and the "difficulty" to use Del & Backspace keys) but at least, he won't find any problem in all his RTL input controls (you can check that in the following script by switching the commented line of the $id_Username control) #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $hGui = GUICreate("", 260, 100, -1, -1, -1, $WS_EX_LAYOUTRTL) GUICtrlCreateLabel("Username", 15, 15, 80, 20) $id_Username = GUICtrlCreateInput("", 80, 10, 100, 20, BitOr($ES_RIGHT, $ES_AUTOHSCROLL)) ; LTR ; $id_Username = GUICtrlCreateInput("", 80, 10, 100, 20) ; RTL $id_OK = GUICtrlCreateButton("OK", 190, 10, 60, 50) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $id_OK GUIDelete($hGui) ExitLoop EndSwitch WEnd It should have been great to use the code of the 1st script for the LTR input control and the code of this 2nd script for all the RTL input controls ! Good luck Mateo Edited January 21, 2021 by pixelsearch typo Link to comment Share on other sites More sharing options...
Mateo Posted January 21, 2021 Author Share Posted January 21, 2021 @Melba23 @pixelsearch I'll check this out soon. Thank you! Link to comment Share on other sites More sharing options...
pixelsearch Posted January 21, 2021 Share Posted January 21, 2021 (edited) @Mateo : you're welcome. @Melba23 : if both precedent scripts aren't enough, here is a 3rd script, which follows your idea to place the LTR input control inside a child window (i.e. the link you provided to Mateo). I succeeded doing it in a simple way, by creating a $WS_CHILD window (and not a $WS_EX_MDICHILD which would steal the focus unless we register etc...) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGui = GUICreate("", 300, 100, -1, -1, -1, $WS_EX_LAYOUTRTL) $id_OK = GUICtrlCreateButton("OK", 220, 10, 60, 50) GUICtrlCreateLabel("Username (RTL)", 10, 15, 85, 20) $id_Username = GUICtrlCreateInput("", 100, 10, 100, 20) ; RTL GUICtrlCreateLabel("Location (LTR)", 10, 45, 85, 20) $hGui2 = GUICreate("", 100, 20, 100, 40, $WS_CHILD, BitOr($WS_EX_NOINHERITLAYOUT, $WS_EX_CONTROLPARENT), $hGui) $id_Location = GUICtrlCreateInput("", 0, 0, 100, 20) ; LTR GUISetState(@SW_SHOW, $hGui) GUISetState(@SW_SHOW, $hGui2) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $id_OK GUIDelete($hGui) GUIDelete($hGui2) ExitLoop EndSwitch WEnd In this 3rd script, $WS_EX_CONTROLPARENT is applied to the $WS_CHILD window, which allows to Tab through all Controls (Parent & Child) fluently. The fact that the Child window has exactly the same size as its inner Input control prevents the "AutoIt feature" to drag the child window here & there. Please note how the cursor is now "well-placed" when we fill any of the Input Controls (RTL or LTR). Also the Del & BackSpace keys behave normally while we fill any of the Input Controls (which wasn't the case in the 2 precedent scripts) So, bye-bye $SS_RIGHT, $ES_RIGHT and all the #Include gang... while $WS_EX_NOINHERITLAYOUT is still here Edited January 21, 2021 by pixelsearch typo 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