Page 1 of 1

Mutiple Constants on panels

Posted: Tue Oct 26, 2004 1:50 am
by -pantcho-
Hi guys!

well few days ago i played with Paul's amazing PBCHAT example.
and i want to add more features to it, like rooms and private messaging
same like IRC.
i use panel gadget for channels, so if i am joining a channel or private messaging someone it means i open a NEW TAB for the panel.
so far so good.

my problem is:
i use a procedure to add new tabs, the problems is that each new TAB
uses the same constants for the gadgets (editorgadget,stringgadget for like MIRC look a like channel) - these resulting gadgets to disappear...

my question is:
how can i open MENY TABS and handle each gadget diffrently ?

thanks you all for replying.

Posted: Tue Oct 26, 2004 4:44 pm
by localmotion34

Code: Select all

Structure gadgets ; this stores all the gadget handles for a tab
  button.l
  checkbox.l
  option.l
  TextGadget.l
EndStructure

Dim panelnumber.gadgets(100);allows up to 100 tabs

Procedure add_panel_with_gadgets(panel,numbertab,text$)
  AddGadgetItem(panel,numbertab,text$)
  panelnumber(numbertab)\button=ButtonGadget(#PB_Any,x,y,width,height,"")
  panelnumber(numbertab)\checkbox=CheckBoxGadget(#PB_Any,x,y,width,height,"")
  panelnumber(numbertab)\option=OptionGadget(#PB_Any,x,y,width,height,"")
  panelnumber(numbertab)\TextGadget=TextGadget(#PB_Any,x,y,width,height,"")
  ;;go on from here until you finish adding your gadgets
EndProcedure 

Posted: Tue Oct 26, 2004 9:19 pm
by -pantcho-
thanks! work like a charm!!
:P :lol:

Posted: Wed Oct 27, 2004 12:59 am
by localmotion34
now to get the gadget events working

Code: Select all

Repeat
  currentpanel=GetGadgetState(panelgadget);this selects the ACTIVE panel
  Event = WaitWindowEvent()
  Select Event 
    Case #PB_EventGadget
      eventtype=EventType()
      Select EventType()
        Case #PB_EventType_LeftClick
          GadgetID = EventGadgetID()
          
          Select GadgetID
            Case panelnumber(currentpanel)\button
              
            Case panelnumber(currentpanel)\checkbox
              
            Case panelnumber(currentpanel)\option
              
          EndSelect 
        Case #PB_EventType_LeftDoubleClick
          GadgetID = EventGadgetID()
          Select GadgetID
            
            
          EndSelect
          eventmenu=EventMenuID()
          Select eventmenu
            
            
          EndSelect
      EndSelect 
    Until Event = #PB_EventCloseWindow
    End

Posted: Sun Oct 31, 2004 2:41 pm
by -pantcho-
Hey Guys thanks.
but it seems that with OpenRichEdit of el_choni it doesnt work either on Panels or on MDI gadget

i tried to make the windowID of the Richedit the frame3dgadget that sourround it but it doesnt work , especially with multiple windows.. .

is richedit limited to 1 window on MDI??