Simple Cross-Platform Gadgets with string input

You can post your code snippets here for others to use and learn from
Murmel
Posts: 31
Joined: Mon Apr 12, 2010 9:03 pm

Re: Simple Cross-Platform Gadgets with string input

Post by Murmel »

@Redlion

Sorry and Thank you :) I have not seen the instruction.hws
With SetGadgetText(50, Text$) Textrefresh is easy.

best regards,
Murmel
Murmel
Posts: 31
Joined: Mon Apr 12, 2010 9:03 pm

Re: Simple Cross-Platform Gadgets with string input

Post by Murmel »

Hi.
New Day, New Question ;)

is it possible GadetLabel to delete ? And to place anew ?
RemoveLayer() brings Specified layer is out of range!

Code: Select all

    GadgetLabel(  33, 20,  300, 300, 25,Wetter$,2) 
    GadgetLabel(  34, 20,  330, 300, 25,Verschimmelt$,2) 
    GadgetLabel(  35, 20,  360, 300, 25,Ernte$,2) 
    GadgetLabel(  42, 20,  450, 300, 25,VolkbenoetigNahrung$,2) 
    GadgetSlider( 43, 20,  480, 100, 25,1000,Kornvorrat[1]) 
    GadgetLabel(  37, 20,  390, 300, 25,Kornvorrat$,2) 
    GadgetLabel(  38, 20,  420, 300, 25,Kornnachfrage$,2) 
    GadgetLabel(  39, 330,  300, 240, 25,Kornpreis$,2) 
I hope you understand me, my English is bad.

Thx,

Murmel
User avatar
Redlion
Posts: 93
Joined: Sun Jul 10, 2011 5:05 am
Location: Perth, Western Australia

Re: Simple Cross-Platform Gadgets with string input

Post by Redlion »

Hi Murmel,

I think I follow what you are asking,
You should be able to change the label text with SetGadgetText(GadgetID,Text$), if there is no border you could change the text to "" (Null$).
If you do not want show the gadget anymore use HideLayer("Gadget"..strstr(GadgetID))
you may have to DisableButton(GadgetID) as well.

BTW I have found a bug in the Frame and Area Gadgets, I will fix them ASAP.

Hope you are finding the Gadgets useful.

Cheers

Redlion
----------------------------------------------------------------------------------------
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
Murmel
Posts: 31
Joined: Mon Apr 12, 2010 9:03 pm

Re: Simple Cross-Platform Gadgets with string input

Post by Murmel »

Hi Redlion.
Redlion wrote:Hi Murmel,

I think I follow what you are asking,
You should be able to change the label text with SetGadgetText(GadgetID,Text$), if there is no border you could change the text to "" (Null$).
If you do not want show the gadget anymore use HideLayer("Gadget"..strstr(GadgetID))
you may have to DisableButton(GadgetID) as well.
yes HideLayer("Gadget"..strstr(GadgetID)) if is the right one, Thanks.
BTW I have found a bug in the Frame and Area Gadgets, I will fix them ASAP.

Hope you are finding the Gadgets useful.

Cheers

Redlion
Hi Redlion.

The Gadgets are cool. :) I try to write a litle Korn Game ;) Do you know Emperor (German Name Kaiser ?)

Image

Your Gui helps very much!

best regards,

Murmel
Murmel
Posts: 31
Joined: Mon Apr 12, 2010 9:03 pm

Re: Simple Cross-Platform Gadgets with string input

Post by Murmel »

Sorry New Question.

Code: Select all

RANDOM = 25
GadgetSpin(107, 400, 330, 80, 25, RANDOM,100)
25.....100 
can i have a Start Value (RANDOM) and nevertheless use 0 - 100 ?

and when i have

Code: Select all

GadgetArea( 81, 10, 270, 780, 340, 0, $979393)
GadgetFrame( 80, 10, 260, 780, 340, "Staatshaushalt", 1)
and use

Code: Select all

HideLayer("Gadget"..StrStr(81))  or (80)
"Cannot find layer "Gadget80" in current BGPic!"

My Fault ?

Thx,

Murmel
User avatar
Redlion
Posts: 93
Joined: Sun Jul 10, 2011 5:05 am
Location: Perth, Western Australia

Re: Simple Cross-Platform Gadgets with string input

Post by Redlion »

Hi Murmel,

No, its not your fault its the bug I was talking about before.

Replace the Area Gadget.hws and Frame Gadget.hws files with these update and I think that will solve your problem.

The only change you may have to do is put the Area or Frame gadget above thegadget you want to display in them otherwise they will cover them.

Links
http://www.indiego.rocks/file/download/ ... bfecac5397
http://www.indiego.rocks/file/download/ ... 0480dba04f

Check the new syntax for these gadgets.

GadgetArea(GID, x, y, w, h, Border, BColor)
GadgetFrame(GID,x,y,w,h,Text$,Border,BColor)

Hope that fixes things.

Redlion
----------------------------------------------------------------------------------------
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
Murmel
Posts: 31
Joined: Mon Apr 12, 2010 9:03 pm

Re: Simple Cross-Platform Gadgets with string input

Post by Murmel »

Hi Redlion.

Thx for your fixes :)

Code: Select all

GadgetArea( 52, 15, 35, 780, 200, $979393, 0)
GadgetFrame( 51, 10, 30, 780, 200, Spielertitel$, 0, $979393)
Show/HideLayer("Gadget"..StrStr(51/52)) works

best regards,

Murmel
sashapont
Posts: 152
Joined: Thu Aug 03, 2017 2:49 pm

Re: Simple Cross-Platform Gadgets with string input

Post by sashapont »

Cool! It is the best lightweight guy!!! Thank you for you work!
Post Reply