Nothing2Lose Posted October 31, 2010 Share Posted October 31, 2010 Hi all, How can i create (a) edit control in the other (like MathType)??? :| Thanks! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 31, 2010 Moderators Share Posted October 31, 2010 Nothing2Lose,Like this perhaps? expandcollapse popup#include <GUIConstantsEx.au3> Global $hGUI_Child = 9999 ; You need this to prevent an error in the GUIGetMsg loop when the child does not exist ; Create parent $hGUI_Parent = GUICreate("Parent", 500, 500) ; Create paretn menu $mFilemenu_Parent = GUICtrlCreateMenu("File") $mEditItem_Parent = GUICtrlCreateMenuitem ("Edit",$mFilemenu_Parent) GUICtrlCreateMenuitem ("",$mFilemenu_Parent) $mExitItem_Parent = GUICtrlCreateMenuitem ("Exit",$mFilemenu_Parent) ; Check remaining client size $aSize = WinGetClientSize($hGUI_Parent) ; And create edit to fill $hEdit_Parent = GUICtrlCreateEdit("Parent Edit Control", 0, 0, $aSize[0], $aSize[1]) GUISetState() While 1 ; Use advanced parameter to distinguish between GUIs $aMsg = GUIGetMsg(1) Switch $aMsg[1] Case $hGUI_Parent Switch $aMsg[0] Case $GUI_EVENT_CLOSE, $mExitItem_Parent ; Parent wants to exit so exit script Exit Case $mEditItem_Parent ; Disable menu item GUICtrlSetState($mEditItem_Parent, $GUI_DISABLE) ; Create child GUI $hGUI_Child = GUICreate("Child", 200, 200, -1, -1, -1, -1, $hGUI_Parent) $mFilemenu_Child = GUICtrlCreateMenu("File") $mInsertItem_Child = GUICtrlCreateMenuitem ("Insert",$mFilemenu_Child) GUICtrlCreateMenuitem ("",$mFilemenu_Child) $mExitItem_Child = GUICtrlCreateMenuitem ("Exit",$mFilemenu_Child) $hEdit_Child = GUICtrlCreateEdit("Child Edit Control", 0, 0, 200, 200) GUISetState() EndSwitch Case $hGUI_Child Switch $aMsg[0] Case $mInsertItem_Child ; Insert current child text into parent and close child $sText = GUICtrlRead($hEdit_Child) GUICtrlSetData($hEdit_Parent, $sText, " ") ContinueCase ; Carry on into next Case Case $GUI_EVENT_CLOSE, $mExitItem_Child ; Child wants to exit so close child GUIDelete($hGUI_Child) GUICtrlSetState($mEditItem_Parent, $GUI_ENABLE) EndSwitch EndSwitch WEndIf the GUIGetMsg loop seems overcomplicated, look at the Managing Multiple GUIs tutorial in the Wiki to understand why. 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...
Nothing2Lose Posted October 31, 2010 Author Share Posted October 31, 2010 (edited) Thank you! But i want to talk about this (see attachment :-) ). Edited October 31, 2010 by Nothing2Lose Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 31, 2010 Moderators Share Posted October 31, 2010 Nothing2Lose, Do you not think that it would have helped to have included that picture in your original post? Writing code for people who ask a clear question and then change the goalposts when given a valid solution is not how I prefer to spend my time here. 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...
Nothing2Lose Posted October 31, 2010 Author Share Posted October 31, 2010 Ah. One more question! How can i display maths symbols (square root, sum,...) in a GUI? Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 1, 2010 Share Posted November 1, 2010 Those characters require Unicode. You could do this, for example: #include <GuiConstantsEx.au3> ; Change encoding of script file to UTF-8 $hGUI = GUICreate("Unicode Text Test", 400, 300) $sString = "This is UTF-8 Unicode:" & @CRLF & "Where n ≠ 0; a ± n ≠ a" & @CRLF & "2³ = 8" $idLabel = GUICtrlCreateLabel($sString, 20, 20, 360, 100) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSEThere is no magic inside AutoIt that makes that work, it simply supports the use of Unicode. What matters is that the Windows APIs used, or the app you are working with, can display the Unicode you want to use. For example, that code will not display properly in SciTE4AutoIt3 unless you change the script file encoding to UTF. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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