Mutiple Constants on panels

Just starting out? Need help? Post your questions and find answers here.
-pantcho-
User
User
Posts: 10
Joined: Tue Sep 21, 2004 8:49 pm
Contact:

Mutiple Constants on panels

Post 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.
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post 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 

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
-pantcho-
User
User
Posts: 10
Joined: Tue Sep 21, 2004 8:49 pm
Contact:

Post by -pantcho- »

thanks! work like a charm!!
:P :lol:
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post 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

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
-pantcho-
User
User
Posts: 10
Joined: Tue Sep 21, 2004 8:49 pm
Contact:

Post 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??
Post Reply