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