NiTroGen Posted September 13, 2007 Share Posted September 13, 2007 (edited) We have a lot of function pairs like GUICtrlGetState & GUICtrlSetState GUICtrlGetStyle & GUICtrlSetStyle BUT GUICtrlRead & GUICtrlSetData I understand that GUICtrlRead can return additional state information, but for more easy understanding, how about renaming GUICtrlRead to GUICtrlGetData? (When I am a GUI newbie, I did spend some time to find out this function as I assume it should be called GUICtrlGetData) Edited September 13, 2007 by NiTroGen Link to comment Share on other sites More sharing options...
JBeef Posted September 13, 2007 Share Posted September 13, 2007 not rename... alias... Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 13, 2007 Share Posted September 13, 2007 Aliases cause a bloated interpreter. Renaming it causes broken code. Neither is a great solution. Link to comment Share on other sites More sharing options...
DjDeep00 Posted September 13, 2007 Share Posted September 13, 2007 Exactly neither is a great solution. Obviously when you are beginner you are not really used to anything but over a period of time you will get used it just fine. Trust me you will! Link to comment Share on other sites More sharing options...
NiTroGen Posted September 14, 2007 Author Share Posted September 14, 2007 I never support alias. For renaming, it should be easy. Just a minutes of automatic search & replace for all au3/decompressed chm files can do. In the past, TimerStart was being renamed as TimerInit. Therefore, I expect renaming of function is allowed in autoit development, if bearing strong reason. Moreover, how come GUICtrlRead is not being named "GUICtrlSetData" at the beginning? Anyone can give me some hints? Link to comment Share on other sites More sharing options...
JBeef Posted September 14, 2007 Share Posted September 14, 2007 Anyone can give me some hints?who knows. you rename and break stuff. alias and everyone is ok. Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 14, 2007 Share Posted September 14, 2007 Just rename them in a UDF and #include it if it bothers you that much. Func MyNewName($param1, $param2) Return OldFunc($param1, $param2) EndFunc Link to comment Share on other sites More sharing options...
sandman Posted September 15, 2007 Share Posted September 15, 2007 (edited) Yeah, I have an include somewhere down deep in my HDD called Irregularities.au3 that fixes some of this stuff.. but Richard is right. It really doesn't matter that much, I just used that when I used to forget all the function names Edited September 15, 2007 by sandman [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center] Link to comment Share on other sites More sharing options...
NiTroGen Posted September 18, 2007 Author Share Posted September 18, 2007 @sandman Would you share your Irregularities.au3 Link to comment Share on other sites More sharing options...
sandman Posted September 22, 2007 Share Posted September 22, 2007 @sandman Would you share your Irregularities.au3I couldn't find it.. so here's one I whipped up for ya:expandcollapse popup#include-once #cs =============================================================================== Description: Rename a file. Parameter(s): $sOriginal: The original file name. $sNew: The desired file name. $iFlag: Determines whether or not to overwrite files with the same name. 0 (default) : Do not overwrite files. 1 : Overwrite existing files. Requirement(s): None. Return Value(s): On Success: 1 On Failure: 0 Author(s): sandman Note(s): =============================================================================== #ce Func FileRename($sOriginal, $sNew, $iFlag = 0) Local $move = FileMove($sOriginal, $sNew, $iFlag) If $move = 0 Then Return 0 Else Return 1 EndIf EndFunc #cs =============================================================================== Description: Get the data of a control. Parameter(s): $hControl: The control identifier (controlID) as returned by a GUICtrlCreate... function. $iAdvanced: Returns extended information of a control. 0 (default) : Returns a value with the data of a control. 1 : Returns extended information of a control (see Notes #2) Requirement(s): A valid created control. Return Value(s): On Success: The data of the control. On Failure: 0 Author(s): sandman Note(s): #1 Type Value Checkbox, Radio State of the button. Combo, List The value selected Input, Edit The text entered Button The display text Date The selected date Progress Current percentage Slider Current value Tab The number or the controlID of the tabitem selected depending of the advanced parameter value. Menu, MenuItem State of the menu/item. See State table TreeView Control identifier (controlID) of the selected TreeViewItem TreeViewItem State of the TreeViewItem ListView Control identifier (controlID) of the selected ListViewItem. 0 means no item is selected Dummy The value set by GUICtrlSendToDummy or GUICtrlSetData #2 In advanced mode the return value contains additional data of the control. Type Additional Value Checkbox, Radio The text of the control. Menu, MenuItem The text of the control. TreeView The text of the current selected TreeViewItem. TreeViewItem The text of the TreeViewItem. ListViewItem The state of the ListViewItem if $LVS_EX_CHECKBOXES exStyle used in advanced mode. See State table Tab The controlID of the tabitem selected =============================================================================== #ce Func GUICtrlGetData($hControl, $iAdvanced = 0) Local $read = GUICtrlRead($hControl, $iAdvanced) If $read <> 0 Then Return $read Else Return 0 EndIf EndFunc [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center] Link to comment Share on other sites More sharing options...
NiTroGen Posted September 25, 2007 Author Share Posted September 25, 2007 @sandman Thanks Link to comment Share on other sites More sharing options...
jvanegmond Posted September 25, 2007 Share Posted September 25, 2007 I couldn't find it.. so here's one I whipped up for ya:Sandman, Func FileRename($sOriginal, $sNew, $iFlag = 0) Return FileMove($sOriginal, $sNew, $iFlag) EndFunc github.com/jvanegmond 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