It is currently 01 Jan 2010, 07:51

Welcome
Welcome to the SDB Engine Forum!
You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!


Post a new topicPost a reply Page 2 of 2   [ 22 posts ]
Go to page Previous  1, 2
Author Message
 Post subject: Re: String Box
PostPosted: 03 Nov 2008, 20:54 
Site Admin
User avatar

Joined: 22 Mar 2007, 22:50
Posts: 112
Don't worry mate, I'm happy to help :D


Top
 Profile  
 
 Post subject: Re: String Box
PostPosted: 04 Nov 2008, 00:47 

Joined: 27 May 2008, 19:38
Posts: 67
Location: Dresden / Germany
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. :-( So it is hard to guess, what keyword and structure I would have to use (or I am really to stupid for all that), as it seems to be not so consitent. So, I don't want to bother you or mean it in no way angry, so please don't misunderstand me!!! ScuiLib is fantastic! But I guess all I need is the same example you give with the NewObject() example with Set() (and maybe Get()) for each IFO CLASS. What do you think?

Good night, mate!

_________________
CD32 + SX1; AmiKit (WinUAE) + OS3.9


Top
 Profile  
 
 Post subject: Re: String Box
PostPosted: 04 Nov 2008, 02:22 
Site Admin
User avatar

Joined: 22 Mar 2007, 22:50
Posts: 112
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 :wink:

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'


Top
 Profile  
 
 Post subject: Re: String Box
PostPosted: 05 Nov 2008, 10:16 

Joined: 27 May 2008, 19:38
Posts: 67
Location: Dresden / Germany
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 :wink:

Well ... :-) No, I don't want you to change that, as this would mean a lot of work for you (there are more expamples, not just position) and I am not sure whether it is worth it. It just would be good to alter the documentation with a coressponding (and complex?) example.
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 ... :-) But thanks!

[quote="Allanon"]
'night, it's pretty late! O_o'
[/quote ]
True! O.O

_________________
CD32 + SX1; AmiKit (WinUAE) + OS3.9


Top
 Profile  
 
 Post subject: Re: String Box
PostPosted: 07 Dec 2008, 16:52 

Joined: 27 May 2008, 19:38
Posts: 67
Location: Dresden / Germany
Hey Fabio,

do you know, when the String Boxes support Multiline >= 2?

Thanks, mate!

_________________
CD32 + SX1; AmiKit (WinUAE) + OS3.9


Top
 Profile  
 
 Post subject: Re: String Box
PostPosted: 07 Dec 2008, 22:54 
Site Admin
User avatar

Joined: 22 Mar 2007, 22:50
Posts: 112
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.

:wink:


Top
 Profile  
 
 Post subject: Re: String Box
PostPosted: 07 Dec 2008, 23:07 

Joined: 27 May 2008, 19:38
Posts: 67
Location: Dresden / Germany
Wow, ok ... Sounds groovy! :-) Not a problem, that it will last a while, I was just curious. :-)

Thanks and good night!

_________________
CD32 + SX1; AmiKit (WinUAE) + OS3.9


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 2 of 2   [ 22 posts ]
Go to page Previous  1, 2


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron