May 08, 2024, 06:45:51 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Please help me out with this very easy question

Started by Hobo, August 21, 2008, 09:44:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hobo

Somewhere I have to start. Please help me out how to connect with mouse clicked on button (B1) to activate Sub ListBox1.
Eventually I would like to add more buttons that would activate different ListBox sub routines.


DEF win:WINDOW

WINDOW win,0,0,200,300,@MINBOX|@MAXBOX,0," CURVE Wiz",Handler
SETWINDOWCOLOR win,RGB(255,255,0)

'Draw B1'
CONTROL win,"B,B1,5,5,50,20,0,1"

run =  1
WAITUNTIL run=0
CLOSEWINDOW win
END

Handler:
IF @CLASS=@IDCLOSEWINDOW
   run = 0
ENDIF
RETURN

SUB ListBox1
CONTROL win,"E,Curve,120,5,70,20,0,3"
CONTROL win,"E,Curve,120,30,70,20,0,4"
CONTROL win,"T,X=,90,5,30,20,0,5"
SETCONTROLCOLOR win,5,0,rgb(255,255,0)
CONTROL win,"T,Y=,90,30,30,20,0,6"
SETCONTROLCOLOR win,6,0,rgb(255,255,0)
RETURN

mrainey

Here's one way.  Others will undoubtedly have better ones.


DEF win:WINDOW

WINDOW win,0,0,200,300,@MINBOX|@MAXBOX,0," CURVE Wiz",Handler
SETWINDOWCOLOR win,RGB(255,255,0)

'Draw B1'
CONTROL win,"B,B1,5,5,50,20,0,1"

CONTROL win,"E,Curve,-1000,-1000,70,20,0,3"
CONTROL win,"E,Curve,-1000,-1000,70,20,0,4"
CONTROL win,"T,X=,-1000,-1000,30,20,0,5"
SETCONTROLCOLOR win,5,0,rgb(255,255,0)
CONTROL win,"T,Y=,-1000,-1000,30,20,0,6"

run =  1
WAITUNTIL run=0
CLOSEWINDOW win
END

SUB ListBox1
SETCONTROLCOLOR win,5,0,rgb(255,255,0)
SETCONTROLCOLOR win,6,0,rgb(255,255,0)
SETSIZE win,120,5,70,20,3
SETSIZE win,120,30,70,20,4
SETSIZE win,90,5,30,20,5
SETSIZE win,90,30,30,20,6
RETURN

Handler:
IF @CLASS=@IDCLOSEWINDOW
   run = 0
ENDIF

SELECT @CONTROLID
    CASE 1
       GOSUB ListBox1
ENDSELECT
RETURN
Software For Metalworking
http://closetolerancesoftware.com

aurelCB

Here is another way:
DEF win:WINDOW
DEF lbopen:int
WINDOW win,0,0,200,300,@MINBOX|@MAXBOX,0," CURVE Wiz",Handler
SETWINDOWCOLOR win,RGB(255,255,0)

'Draw B1'
CONTROL win,"B,B1,5,5,50,20,0,1"

run =  1
WAITUNTIL run=0
CLOSEWINDOW win
END

Handler:
IF @CLASS=@IDCLOSEWINDOW
   run = 0
ENDIF
IF @CLASS=@IDCREATE
   Centerwindow win
ENDIF
IF @CLASS=@IDCONTROL
IF (@controlid=1)&(lbopen=0)
Gosub Listbox1
ENDIF
ENDIF
RETURN

SUB ListBox1
CONTROL win,"E,Curve,120,5,70,20,0,3"
CONTROL win,"E,Curve,120,30,70,20,0,4"
CONTROL win,"T,X=,90,5,30,20,0,5"
SETCONTROLCOLOR win,5,0,rgb(255,255,0)
CONTROL win,"T,Y=,90,30,30,20,0,6"
SETCONTROLCOLOR win,6,0,rgb(255,255,0)
lbopen=1
RETURN

aurelCB

And this is third way:

DEF win:WINDOW
DEF listbox1open:int
WINDOW win,0,0,200,300,@MINBOX|@MAXBOX,0," CURVE Wiz",Handler
SETWINDOWCOLOR win,RGB(255,255,0)

'Draw B1'
CONTROL win,"B,B1,5,5,50,20,0,1"

run =  1
WAITUNTIL run=0
CLOSEWINDOW win
END

Handler:
SELECT @CLASS

CASE @IDCLOSEWINDOW
    run = 0

CASE @IDCREATE
    Centerwindow win

CASE @IDCONTROL
IF (@controlid=1)&(listbox1open=0)
Gosub Listbox1
ENDIF

ENDSELECT
RETURN

SUB ListBox1
CONTROL win,"E,Curve,120,5,70,20,0,3"
CONTROL win,"E,Curve,120,30,70,20,0,4"
CONTROL win,"T,X =,90,5,30,20,0,5"
SETCONTROLCOLOR win,5,0,rgb(255,255,0)
CONTROL win,"T,Y =,90,30,30,20,0,6"
SETCONTROLCOLOR win,6,0,rgb(255,255,0)
listbox1open=1
RETURN

Hobo

Thank you very much both of you. I am going to study these samples you have given to me and hopefully I able to further develop this little program that I would like to create to help my work to do some calculations.


Hobo

This is great.
I added another button that opens another listbox. It is working except I need a remove command to clear one listbox when I open the other one.
Later I want to put numbers in listboxes and do some calculations with them, but that is later.

Thank you again, and if I am too much anoyance just let me know. :-)


DEF win:WINDOW
DEF listbox1open,listbox2open:int
WINDOW win,0,0,200,300,@MINBOX,0," CURVE Wiz",Handler
SETWINDOWCOLOR win,RGB(255,255,0)

'Draw Button1 & Button2'
CONTROL win,"B,B1,5,5,50,20,0,1"
CONTROL win,"B,B2,5,30,50,20,0,2"

run =  1
WAITUNTIL run=0
CLOSEWINDOW win
END

Handler:
SELECT @CLASS

   CASE @IDCLOSEWINDOW
      run = 0

   CASE @IDCREATE
      Centerwindow win
   
   CASE @IDCONTROL
      IF (@controlid=1)&(listbox1open=0)
      Gosub Listbox1
      ENDIF
      IF (@controlid=2)&(listbox2open=0)
      Gosub Listbox2
      ENDIF

ENDSELECT
RETURN

SUB Listbox1
CONTROL win,"E,CurveX,120,5,70,20,0,3"
CONTROL win,"E,CurveY,120,30,70,20,0,4"
CONTROL win,"T,X =,90,5,30,20,0,5"
SETCONTROLCOLOR win,5,0,rgb(255,255,0)
CONTROL win,"T,Y =,90,30,30,20,0,6"
SETCONTROLCOLOR win,6,0,rgb(255,255,0)
listbox1open=1
RETURN

SUB Listbox2
CONTROL win,"E,CurveA,120,55,70,20,0,7"
CONTROL win,"E,CurveB,120,80,70,20,0,8"
CONTROL win,"T,A =,90,55,30,20,0,9"
SETCONTROLCOLOR win,9,0,rgb(255,255,0)
CONTROL win,"T,B =,90,80,30,20,0,10"
SETCONTROLCOLOR win,10,0,rgb(255,255,0)
listbox2open=1
RETURN

aurelCB

Hi Hobo ...
No problem if we have time and if we know (...i speak for myself).
You create edit controls no listbox .Listbox is diferent type of control.
I forget yet another way for closing window wich is here.
You can also create controls without subroutines,ordinary after window is open.

'hobo example
DEF win:WINDOW
DEF listbox1open,listbox2open:int
WINDOW win,0,0,200,300,@MINBOX,0," CURVE Wiz",Handler
SETWINDOWCOLOR win,RGB(255,255,0)

'Draw Button1 & Button2'
CONTROL win,"B,B1,5,5,50,20,0,1"
CONTROL win,"B,B2,5,30,50,20,0,2"
'here is change
run =  1
WAITUNTIL win=0
END

Handler:
SELECT @CLASS
'and here
   CASE @IDCLOSEWINDOW
      CLOSEWINDOW win

   CASE @IDCREATE
      Centerwindow win
   
   CASE @IDCONTROL
      IF (@controlid=1)&(listbox1open=0)
      Gosub Listbox1
      ENDIF
      IF (@controlid=2)&(listbox2open=0)
      Gosub Listbox2
      ENDIF

ENDSELECT
RETURN

SUB Listbox1
CONTROL win,"E,CurveX,120,5,70,20,0,3"
CONTROL win,"E,CurveY,120,30,70,20,0,4"
CONTROL win,"T,X =,90,5,30,20,0,5"
SETCONTROLCOLOR win,5,0,rgb(255,255,0)
CONTROL win,"T,Y =,90,30,30,20,0,6"
SETCONTROLCOLOR win,6,0,rgb(255,255,0)
listbox1open=1
RETURN

SUB Listbox2
CONTROL win,"E,CurveA,120,55,70,20,0,7"
CONTROL win,"E,CurveB,120,80,70,20,0,8"
CONTROL win,"T,A =,90,55,30,20,0,9"
SETCONTROLCOLOR win,9,0,rgb(255,255,0)
CONTROL win,"T,B =,90,80,30,20,0,10"
SETCONTROLCOLOR win,10,0,rgb(255,255,0)
listbox2open=1
RETURN

aurelCB

Oh just one thing.
You can writte gosub command if you wannt or you can writte like this:
IF (@controlid=1)&(listbox1open=0)
Listbox1()
ENDIF
IF (@controlid=2)&(listbox2open=0)
Listbox2()
ENDIF
Same thing. :)

Hobo

Thanks Aurel and thank you to correct me out with the Edit/List box mix up.

If you have time to look these two programs I wrote in Rapid Q many years ago to help my work. These are .EXE files.
This is what I would like to redo in CB. That is where I am heading.  :)



aurelCB

Hi here is skeleton for your program:

'hobo example
DEF win:WINDOW
DEF listbox1open,listbox2open:int
WINDOW win,0,0,300,300,@MINBOX,0," CURVE Wiz",Handler
SETWINDOWCOLOR win,RGB(235,235,120)


'create buttons'
CONTROL win,"B,AFF,5,5,60,20,0,1"
SETFONT win, "MS Sans Serif", 9, 400,0,1
CONTROL win,"B,HP / AFF,5,30,60,20,0,2"
SETFONT win, "MS Sans Serif", 9, 400,0,2
CONTROL win,"B,CURVE,5,55,60,20,0,3"
SETFONT win, "MS Sans Serif", 9, 400,0,3
CONTROL win,"B,HP-SCL,5,80,60,20,0,4"
SETFONT win, "MS Sans Serif", 9, 400,0,4
CONTROL win,"B,NPSH,5,105,60,20,0,5"
SETFONT win, "MS Sans Serif", 9, 400,0,5
CONTROL win,"B,TRIM,5,130,60,20,0,6"
SETFONT win, "MS Sans Serif", 9, 400,0,6

CONTROL win,"B,CONV,5,170,60,20,0,7"
SETFONT win, "MS Sans Serif", 9, 400,0,7

CONTROL win,"B,Submit,120,220,80,25,0,8"
SETFONT win, "MS Sans Serif", 9, 400,0,8
'-----------------------------------------
run =  1
WAITUNTIL run=0
CLOSEWINDOW win
END

SUB Handler
SELECT @CLASS

   CASE @IDCLOSEWINDOW
      run=0

   CASE @IDCREATE
      Centerwindow win
   
   CASE @IDCONTROL
      IF (@controlid=1)&(listbox1open=0)
      Listbox1()
      ENDIF
      'IF (@controlid=2)&(listbox2open=0)
      'Listbox2()
      'ENDIF

ENDSELECT
RETURN

'////////////////////////////////////////////////
SUB Listbox1
'create static & edit controls(ID from 11 to 30)
CONTROL win,"E,CurveX,200,70,70,20,0,11"
SETFONT win, "MS Sans Serif", 9, 400,0,11
'---------------------------------------
CONTROL win,"E,CurveY,200,100,70,20,0,12"
SETFONT win, "MS Sans Serif", 9, 400,0,12
'--------------------------------------
CONTROL win,"T,X =,120,70,80,20,0,30"
SETCONTROLCOLOR win,30,0,RGB(235,235,120)
SETFONT win, "MS Sans Serif", 9, 400,0,30
'with this command you change control text
SETCONTROLTEXT win,30,"Wanted RPM"
'----------------------------------------
CONTROL win,"T,Y =,120,100,80,20,0,31"
SETCONTROLCOLOR win,31,0,RGB(235,235,120)
SETFONT win, "MS Sans Serif", 9, 400,0,31
SETCONTROLTEXT win,31,"Enter Old RPM"
'---------------------------------------
'set veriable to one=sub activated
listbox1open=1
'RETURN
LINE win,100,125,280,125
'SUB Listbox2
CONTROL win,"E,CurveA,200,130,70,20,0,13"
SETFONT win, "MS Sans Serif", 9, 400,0,13
CONTROL win,"E,CurveB,200,160,70,20,0,14"
SETFONT win, "MS Sans Serif", 9, 400,0,14
'----------------------------------------
CONTROL win,"T,X =,160,130,30,20,0,32"
SETCONTROLCOLOR win,32,0,RGB(235,235,120)
SETFONT win, "MS Sans Serif", 9, 400,0,32
'----------------------------------------
CONTROL win,"T,Y =,160,160,30,20,0,33"
SETCONTROLCOLOR win,33,0,RGB(235,235,120)
SETFONT win, "MS Sans Serif", 9, 400,0,33
'-----------------------------------
'listbox2open=1
RETURN

Hobo

Aurelâ€Ã,¦I really thank you for all the help. It is very kind of you to spend time with my little program. I really enjoy study your codes and all.

I downloaded many programs and samples from this site, but I still not finding the right commands I need to complete this program of mine. Would you tell me what command I should use to get input from edit box and show output in edit box, I am thinking numbers? Like â€Ã...“xâ€Ã, button pressed get input form â€Ã...“yâ€Ã,, perhaps â€Ã...“zâ€Ã, edit boxes, then I would do the calculation in a subroutine and then show the output in another edit box.


And I still don’t know how to hide edit boxes. So if I click a button, I would like to clear an existing edit box or boxes.

I don’t ask you to write me the program. If you would just help me with the commands? Just let me know what commands I should play around with?

Perhaps in the near future when I have completed this program, I could share with all of the guys here. Also, it could be a helpful sample for other CB beginners.

Ionic Wind Support Team

See:  Users Guide - > SetControlText

SetControlText win, 99, ""

If 99 was the ID of your edit control.
Ionic Wind Support Team

aurelCB

Hi Hobo i undersand what you mean...
Like mr.Paul said first read help.
Last night i spend 2 hours reading help for Rich Edit control and i find solution- i know not very well ::)
So...
Every control you can hide and show.
If you want read contest of edit box you must use command:
text$ = GETCONTROLTEXT (window | dialog, ID)
Of course you must firs define string variable text$ with DEF - or DIM text$ As String if you like this shape.
Second command is :
SETCONTROLTEXT window | dialog, ID, text
and everything woul be ok -- i hope
regards
aurel

aurelCB

Every control you can hide and show.
I think but i never use hiding controls ,
i only use hide  window -- show window.
Someone else know much about controls then me.

LarryMc

Hide/show controls is same as windows; you just add the control id on the end

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Hobo

Thank you all the help.
I think I can do the rest, but again it takes only a bit of information
to to loose rest of your hair. :)

Hobo

I mean a little bit of information placed in a wrong place or not to placed in the right place,
that all it takes to have nothing.

Thanks again

Hobo

mrainey

QuoteI mean a little bit of information placed in a wrong place or not to placed in the right place,
that all it takes to have nothing.

Yep, that's programming!   :D
Software For Metalworking
http://closetolerancesoftware.com

Hobo

It seems hiding Edit Box only makes the Edit Box invisible, but in real it is still there. That is why I got error in
"SUB add2number" (line 56).

Is there any command to turn Controls on and off? In this case an Edit Box?

I would like a back and forth operation showing Edit Boxes.

'hobo example
DEF win:WINDOW
DEF add2numberopen,add3numberopen:int

WINDOW win,0,0,200,300,@MINBOX,0," CURVE Wiz",Handler
SETWINDOWCOLOR win,RGB(255,255,0)
Centerwindow win

'Draw Buttons'
CONTROL win,"B,Add2Num,5,5,60,20,0,1"
SETFONT win, "MS Sans Serif", 9, 400,0,1
CONTROL win,"B,Add3Num,5,30,60,20,0,2"
SETFONT win, "MS Sans Serif", 9, 400,0,2

run =  1
WAITUNTIL win=0
END

Handler:
SELECT @CLASS

   CASE @IDCLOSEWINDOW
      CLOSEWINDOW win
   
   CASE @IDCONTROL
IF (@controlid=1)&(add3numberopen=1)
showwindow win, @swhide,9
add3numberopen=0
ENDIF
IF (@controlid=1)&(add2numberopen=0)
'showwindow win, @swhide,9
add2number()
ENDIF
IF (@controlid=2)&(add3numberopen=0)
add3number()
    ENDIF

ENDSELECT
RETURN

SUB add2number
CONTROL win,"E,inputX,120,40,70,20,0,3"
CONTROL win,"E,inputY,120,65,70,20,0,4"

LINE win,100,100,190,100

CONTROL win,"E,output,120,115,70,20,0,7"
CONTROL win,"T,Sum =,75,115,30,20,0,8"
SETFONT win, "MS Sans Serif", 9, 400,0,8
SETCONTROLCOLOR win,8,0,rgb(255,255,0)

add2numberopen=1
RETURN

SUB add3number
CONTROL win,"E,inputZ,120,15,70,20,0,9"

add3numberopen=1
RETURN


LarryMc

See if this is what you're trying to do:'hobo example
DEF win:WINDOW
DEF add2numberopen,add3numberopen:int

WINDOW win,0,0,200,300,@MINBOX,0," CURVE Wiz",Handler
SETWINDOWCOLOR win,RGB(255,255,0)
Centerwindow win

'Draw Buttons'
CONTROL win,"B,Add2Num,5,5,60,20,0,1"
SETFONT win, "MS Sans Serif", 9, 400,0,1
CONTROL win,"B,Add3Num,5,30,60,20,0,2"
SETFONT win, "MS Sans Serif", 9, 400,0,2
'add edit fields
CONTROL win,"E,inputX,120,40,70,20,0,3"
showwindow win, @swhide,3
CONTROL win,"E,inputY,120,65,70,20,0,4"
showwindow win, @swhide,4
CONTROL win,"E,inputZ,120,15,70,20,0,9"
showwindow win, @swhide,9
CONTROL win,"E,output,120,115,70,20,0,7"
showwindow win, @swhide,7
CONTROL win,"T,Sum =,75,115,30,20,0,8"
showwindow win, @swhide,8
SETFONT win, "MS Sans Serif", 9, 400,0,8
SETCONTROLCOLOR win,8,0,rgb(255,255,0)
LINE win,100,100,190,100,RGB(255,255,0)

run =  1
WAITUNTIL win=0
END

Handler:
SELECT @CLASS

   CASE @IDCLOSEWINDOW
      CLOSEWINDOW win
   
   CASE @IDCONTROL
IF (@controlid=1)&(add3numberopen=1)
showwindow win, @swhide,9
add3numberopen=0
ENDIF
IF (@controlid=1)&(add2numberopen=0)
'showwindow win, @swhide,9
add2number()
ENDIF
IF (@controlid=2)&(add3numberopen=0)
add3number()
    ENDIF

ENDSELECT
RETURN

SUB add2number
LINE win,100,100,190,100
showwindow win, @swrestore,3
showwindow win, @swrestore,4
showwindow win, @swhide,9
showwindow win, @swrestore,7
showwindow win, @swrestore,8
add2numberopen=1
RETURN

SUB add3number
LINE win,100,100,190,100
showwindow win, @swrestore,3
showwindow win, @swrestore,4
showwindow win, @swrestore,9
showwindow win, @swrestore,7
showwindow win, @swrestore,8
add3numberopen=1
RETURN


Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Hobo

Yes, that is exactly what I  tried to do. Thank you Larry

So the answer is once you have created the edit box, there is no command to remove it.  Only to manipulate it with @swhide and  @swrestore. Would have been nice to just turn it off and on, because this way even if it is hidden, you still have to deal with its current state. Am I right, or talking nonsense?  :D

Rege

LarryMc

Now, using windows api's there is a way to delete a control directly; then your re-creating it would not be a problem.

But really, with the code I provided it's not hard to handle the value in the hiden control; just don't do a GETCONTROLTEXT on it if the add 2 flag is set.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

aurelCB

You can remove edit boxes if you create child window and
every time when you press button close child window then
open with new edit boxes.

aurelCB

Hi hobo
Here is example:

'hobo example
DEF win:WINDOW
def panel1,panel2:window
def p1,p2:int
DEF listbox1open,listbox2open:int
WINDOW win,0,0,300,300,@MINBOX,0," CURVE Wiz",main
SETWINDOWCOLOR win,RGB(222,222,222)


'create buttons'
CONTROL win,"B,AFF,5,5,60,20,0,1"
SETFONT win, "MS Sans Serif", 9, 400,0,1
CONTROL win,"B,HP / AFF,5,30,60,20,0,2"
SETFONT win, "MS Sans Serif", 9, 400,0,2
CONTROL win,"B,CURVE,5,55,60,20,0,3"
SETFONT win, "MS Sans Serif", 9, 400,0,3
CONTROL win,"B,HP-SCL,5,80,60,20,0,4"
SETFONT win, "MS Sans Serif", 9, 400,0,4
CONTROL win,"B,NPSH,5,105,60,20,0,5"
SETFONT win, "MS Sans Serif", 9, 400,0,5
CONTROL win,"B,TRIM,5,130,60,20,0,6"
SETFONT win, "MS Sans Serif", 9, 400,0,6

CONTROL win,"B,CONV,5,170,60,20,0,7"
SETFONT win, "MS Sans Serif", 9, 400,0,7

CONTROL win,"B,Submit,120,220,80,25,0,8"
SETFONT win, "MS Sans Serif", 9, 400,0,8
'-----------------------------------------
run =  1
WAITUNTIL run=0
CLOSEWINDOW win
END

SUB main
SELECT @CLASS

   CASE @IDCLOSEWINDOW
      run=0

   CASE @IDCREATE
      Centerwindow win
   
   CASE @IDCONTROL
      IF (@controlid=1):'&(listbox1open=0)
      Listbox1()
      ENDIF
      IF (@controlid=2):'&(listbox2open=0)
      Listbox2()
      ENDIF

ENDSELECT
RETURN

'////////////////////////////////////////////////
SUB Listbox1
'If listbox1open=1
' Return
'Endif
If p2=1
closewindow panel2
p2=0
Endif
window panel1,100,20,190,150,@nocaption|@border/2,win,"panel1",main
SETWINDOWCOLOR panel1,RGB(222,222,222)
p1=1
'create static & edit controls(ID from 11 to 30)
CONTROL panel1,"E,,70,20,70,20,0x50800000,11"
SETFONT panel1, "MS Sans Serif", 9, 400,0,11
'---------------------------------------
CONTROL panel1,"E,,70,50,70,20,0x50800000,12"
SETFONT panel1, "MS Sans Serif", 9, 400,0,12
'--------------------------------------
CONTROL panel1,"T,X =,20,70,80,20,0x5000010B,30"
SETCONTROLCOLOR panel1,30,rgb(0,0,0),RGB(222,222,222)
SETFONT panel1, "MS Sans Serif", 9, 400,0,30
'with this command you change control text
SETCONTROLTEXT panel1,30,"Wanted RPM"
'----------------------------------------
CONTROL panel1,"T,Y =,20,100,80,20,0,31"
SETCONTROLCOLOR panel1,31,rgb(0,0,0),RGB(222,222,222)
SETFONT panel1, "MS Sans Serif", 9, 400,0,31
SETCONTROLTEXT panel1,31,"Enter Old RPM"
'---------------------------------------
'set veriable to one=sub activated
listbox1open=1
RETURN

LINE win,100,125,280,125

SUB Listbox2
'If listbox2open=1
' Return
'Endif
If p1=1
closewindow panel1
p1=0
Endif
window panel2,100,20,190,150,@nocaption|@border/2,win,"panel2",main
SETWINDOWCOLOR panel2,RGB(222,222,222)
p2=1
CONTROL panel2,"E,CurveA,70,20,70,20,0,13"
SETFONT panel2, "MS Sans Serif", 9, 400,0,13
CONTROL panel2,"E,CurveB,70,50,70,20,0,14"
SETFONT panel2, "MS Sans Serif", 9, 400,0,14
'----------------------------------------
CONTROL panel2,"T,X =,20,20,30,20,0,32"
SETCONTROLCOLOR panel2,32,0,RGB(222,222,222)
SETFONT panel2, "MS Sans Serif", 9, 400,0,32
'----------------------------------------
CONTROL panel2,"T,Y =,20,50,30,20,0,33"
SETCONTROLCOLOR panel2,33,0,RGB(222,222,222)
SETFONT panel2, "MS Sans Serif", 9, 400,0,33
'-----------------------------------
listbox2open=1
RETURN

aurelCB

Hi again...
Here is code if you wannt control more then two panels:

'hobo 5 example/by aurel
DEF win:WINDOW
def panel1,panel2:window
def p:int
DEF listbox1open,listbox2open:int
WINDOW win,0,0,300,300,@MINBOX,0," CURVE Wiz",main
SETWINDOWCOLOR win,RGB(222,222,222)


'create buttons'
CONTROL win,"B,AFF,5,5,60,20,0,1"
SETFONT win, "MS Sans Serif", 9, 400,0,1
CONTROL win,"B,HP / AFF,5,30,60,20,0,2"
SETFONT win, "MS Sans Serif", 9, 400,0,2
CONTROL win,"B,CURVE,5,55,60,20,0,3"
SETFONT win, "MS Sans Serif", 9, 400,0,3
CONTROL win,"B,HP-SCL,5,80,60,20,0,4"
SETFONT win, "MS Sans Serif", 9, 400,0,4
CONTROL win,"B,NPSH,5,105,60,20,0,5"
SETFONT win, "MS Sans Serif", 9, 400,0,5
CONTROL win,"B,TRIM,5,130,60,20,0,6"
SETFONT win, "MS Sans Serif", 9, 400,0,6

CONTROL win,"B,CONV,5,170,60,20,0,7"
SETFONT win, "MS Sans Serif", 9, 400,0,7

CONTROL win,"B,Submit,120,220,80,25,0,8"
SETFONT win, "MS Sans Serif", 9, 400,0,8
'-----------------------------------------
run =  1
WAITUNTIL run=0
CLOSEWINDOW win
END

SUB main
SELECT @CLASS

   CASE @IDCLOSEWINDOW
      run=0

   CASE @IDCREATE
      Centerwindow win
   
   CASE @IDCONTROL
      IF (@controlid=1):'&(listbox1open=0)
checkpanel()
      Listbox1()
      ENDIF
      IF (@controlid=2):'&(listbox2open=0)
checkpanel()
      Listbox2()
      ENDIF
'open next panel---------------
'IF (@controlid=3):
' checkpanel()
     ' Listbox3()
     ' ENDIF


ENDSELECT
RETURN

'////////////////////////////////////////////////
SUB Listbox1

window panel1,100,20,190,150,@nocaption|@border/2,win,"panel1",main
SETWINDOWCOLOR panel1,RGB(222,222,222)
p=1
'create static & edit controls(ID from 11 to 30)
CONTROL panel1,"E,,70,20,70,20,0x50800000,11"
SETFONT panel1, "MS Sans Serif", 9, 400,0,11
'---------------------------------------
CONTROL panel1,"E,,70,50,70,20,0x50800000,12"
SETFONT panel1, "MS Sans Serif", 9, 400,0,12
'--------------------------------------
CONTROL panel1,"T,X =,20,70,80,20,0x5000010B,30"
SETCONTROLCOLOR panel1,30,rgb(0,0,0),RGB(222,222,222)
SETFONT panel1, "MS Sans Serif", 9, 400,0,30
'with this command you change control text
SETCONTROLTEXT panel1,30,"Wanted RPM"
'----------------------------------------
CONTROL panel1,"T,Y =,20,100,80,20,0,31"
SETCONTROLCOLOR panel1,31,rgb(0,0,0),RGB(222,222,222)
SETFONT panel1, "MS Sans Serif", 9, 400,0,31
SETCONTROLTEXT panel1,31,"Enter Old RPM"
'---------------------------------------
'set veriable to one=sub activated
listbox1open=1
RETURN

LINE win,100,125,280,125

SUB Listbox2

Endif
window panel2,100,20,190,150,@nocaption|@border/2,win,"panel2",main
SETWINDOWCOLOR panel2,RGB(222,222,222)
p=2
CONTROL panel2,"E,CurveA,70,20,70,20,0,13"
SETFONT panel2, "MS Sans Serif", 9, 400,0,13
CONTROL panel2,"E,CurveB,70,50,70,20,0,14"
SETFONT panel2, "MS Sans Serif", 9, 400,0,14
'----------------------------------------
CONTROL panel2,"T,X =,20,20,30,20,0,32"
SETCONTROLCOLOR panel2,32,0,RGB(222,222,222)
SETFONT panel2, "MS Sans Serif", 9, 400,0,32
'----------------------------------------
CONTROL panel2,"T,Y =,20,50,30,20,0,33"
SETCONTROLCOLOR panel2,33,0,RGB(222,222,222)
SETFONT panel2, "MS Sans Serif", 9, 400,0,33
'-----------------------------------
listbox2open=1
RETURN

SUB checkpanel
'check if you wannt more panels
select p
CASE 1
closewindow panel1
CASE 2
closewindow panel2
'CASE 3
'closewindow panel3
endselect
Return