jaberwacky Posted April 4, 2010 Share Posted April 4, 2010 (edited) Hi! I'm experimenting with writing a GUI. I decided to try a roundabout way. I was wondering if you could tell me if this is good programming practice? The only thing that you can know about a control is the ControlID. I think that is what I'm going for here. This GUI has no practical purpose other than experimenting. I welcome any and all thoughts, opinions, and criticisms relating to this thread. Thanks and have a wonderful (day|night)! expandcollapse popupLocal $FormID = _createGUI() Func _getGUIWidth() Return @DesktopWidth - 600 EndFunc ;==>_getGUIWidth Func _getGUIHeight() Return @DesktopHeight - 500 EndFunc ;==>_getGUIHeight Func _getGUILeft() Return 10 EndFunc ;==>_getGUILeft Func _getGUITop() Return 10 EndFunc ;==>_getGUITop Func _createGUI() ; create the gui form Local $apFormWidth = _getGUIWIdth() Local $apFormHeight = _getGUIHeight() Local $apFormLeft = _getGUILeft() Local $apFormTop = _getGUITop() Return GUICreate("Experiment", $apFormWidth, $apFormHeight, _getGUILeft(), _getGUITop()) EndFunc ;==>_createGUI ; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Local $fileListID = _createFileList() Func _getFileListWidth() Return 300 EndFunc ;==>_getFileListWidth Func _getFileListHeight() Return 15 * 8 EndFunc ;==>_getFileListHeight Func _getFileListLeft() Return _getGUIWIdth() - _getFileListWidth() - 10 EndFunc ;==>_getFileListLeft Func _getFileListTop() Return 10 EndFunc ;==>_getFileListTop Func _createFileList() Local $apFileListWidth = _getFileListWidth() Local $apFileListHeight = _getFileListHeight() Local $apFileListLeft = _getFileListLeft() Local $apFileListTop = _getFileListTop() Return GUICtrlCreateList("", $apFileListLeft, $apFileListTop, $apFileListWidth, $apFileListHeight) EndFunc ;==>_createFileList ; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Local $labelID = _createLabel() Func _getLabelWidth() Return _getGUIWIdth() - 20 EndFunc ;==>_getLabelWidth Func _getLabelHeight() Return 30 EndFunc ;==>_getLabelHeight Func _getLabelLeft() Return 10 EndFunc ;==>_getFileListLeft Func _getLabelTop() Return _getFileListHeight() + 10 EndFunc ;==>_getFileListTop Func _createLabel() Local $apLabelWidth = _getLabelWidth() Local $apLabelHeight = _getLabelHeight() Local $apLabelLeft = _getLabelLeft() Local $apLabelTop = _getLabelTop() Return GUICtrlCreateLabel("", $apLabelLeft, $apLabelTop, $apLabelWidth, $apLabelHeight) EndFunc ;==>_createLabel Func _messageSend($data = '', $controlID = $labelID) Return GUICtrlSetData($controlID, $data) EndFunc ;==>_messageSend ; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ GUISetState(@SW_SHOW) _messageSend("HI") Sleep(2000) _messageSend() Sleep(2000) Yes, I recently began learning OOP. Edited April 4, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Zedna Posted April 4, 2010 Share Posted April 4, 2010 Look at Koda GUI Designer Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
jaberwacky Posted April 4, 2010 Author Share Posted April 4, 2010 Look at Koda GUI DesignerThanks, after some more experimenting I realized that my method is bassackwards. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? 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