| SDB Engine http://sdb.freeforums.org/ |
|
| String Box http://sdb.freeforums.org/string-box-t10-15.html |
Page 2 of 2 |
| Author: | Allanon [ 03 Nov 2008, 20:54 ] |
| Post subject: | Re: String Box |
Don't worry mate, I'm happy to help |
|
| Author: | Clyde [ 04 Nov 2008, 00:47 ] |
| Post subject: | Re: String Box |
Ok, now I know what makes it hard for me to read the manual, as I have always problems with the Set()-Method ... :-/ For example I wanted to set the Clear1st parameter. I looked the doc all around, but couldn't get it to work. I tried it in this way as this seemed to be logical for me when looking at the NewObject() example of the string box: Code: scui.Set("strSourceFile", { Value = "Please enter or choose the source file!", Clear1st = 1 }, 1 ) Unfortunately that doesn't work. And I think I have a proof the the manual (or the lib) isn't always so intuitional: the example in the "Set & Get" section. Their you set the position of the button by Code: scui.Set("mybutton", { Position = { x = 100, y = 50 } } ) But if I look at the section of IFO CLASS "Button" there is no keyword "position" (in the NewObject() example) to be found. Good night, mate! |
|
| Author: | Allanon [ 04 Nov 2008, 02:22 ] |
| Post subject: | Re: String Box |
Well, the tag Clear1st is not supported by scui.Set because its logic is different from any other tag, and that's because it supposed to be set at the creation time, when the string box is defined. IMO it has not sense to give the ability to the programmer to set the tag in the middle of the code, because the string must be cleared only one time and only the first time it's activated. So the right way to use Clear1st is at creation time like below: Code: scui.NewObject( #IFOCLASS_STRINGBOX, "StringBox1", { x = 10, y = 168 }, { x = 460, y = 20 }, { Enabled = #IFO_ENABLED }, { Values = { "Custom character filter..." }, Lines = 1, InputType = #GETKEY_CUSTOM, Custom = "ABC123", Clear1st = 1, MaxLen = 100, }, { OnExit = myFunc1, OnChange = myFunc2, OnKeyPress = myFunc3 } ) If you need to set the tag at runtime this is not really a problem, I can implement it in no time, but I think that the tag should be changed in <ClearAtNextActivation> or something similar. About the tag Position it is true that during the creation there isn't a tag with this name because the coordinates are passed in a table but this choice has been done to keep thinks separated: class, name, position, size, and so on... it's simplier for me checking this pieces if they are empty or not, or valid or not while it's more complicated check a nasted and huge table with all parameters inside, something like: Code: scui.NewObject({ class = #IFOCLASS_LABEL, name = "myLabel", position = { x = 100, y = 100 }, size = { x = 400, y = 20 }, ...}) I'm not saying that it's impossible because with programming almost is possible but it's more complex, if you think that with this change the code will be more clear and clean then I can plan this change And yes, the documentation it's far to be complete, so don't esistate to ask because in this way I can have an idea of which areas needs more examples (like now), and I try to answer here with appropriate code ; this will help for sure the next releases documentation. cya mate Fabio P.S.: If you need to create tips for your application you can dedicate a label for this purpose, everytime a StringBox is activated you can change the label's text with your String-related tip and when the StringBox is closed you can wipe the tip away with an empty text, maybe is less complex to handle and the user has the tip visible every time he activate the string and not only at the beginning of the program. 'night, it's pretty late! O_o' |
|
| Author: | Clyde [ 05 Nov 2008, 10:16 ] |
| Post subject: | Re: String Box |
Hi Fabio, I wrote you a mail with an example concerning the Clear1st topic ... Allanon wrote: About the tag Position it is true that during the creation there isn't a tag with this name ... I'm not saying that it's impossible because with programming almost is possible but it's more complex, if you think that with this change the code will be more clear and clean then I can plan this change Well ... Well, I just try to figure out whether the is a logical relationship between the NewObject() and Set() or in other words, how can I remember how to use it correctly. Allanon wrote: P.S.: If you need to create tips for your application you can dedicate a label for this purpose, ... Yeah, as you see in my app I sent you I also had this idea ... [quote="Allanon"] 'night, it's pretty late! O_o' [/quote ] True! O.O |
|
| Author: | Clyde [ 07 Dec 2008, 16:52 ] |
| Post subject: | Re: String Box |
Hey Fabio, do you know, when the String Boxes support Multiline >= 2? Thanks, mate! |
|
| Author: | Allanon [ 07 Dec 2008, 22:54 ] |
| Post subject: | Re: String Box |
I'm planning a new class to allow full editing of a multiline element but will come after this release, it's quiet complex because I'd like to implement some sort of basic editor with embedded formatting codes. |
|
| Author: | Clyde [ 07 Dec 2008, 23:07 ] |
| Post subject: | Re: String Box |
Wow, ok ... Sounds groovy! Thanks and good night! |
|
| Page 2 of 2 | All times are UTC + 1 hour |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|