Page 1 of 1

Posted: Sat Dec 21, 2002 12:51 am
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Seems PB have some probs to handle events correctly! For example ComboBox, Network...

So we really need a better and correct working event handling system!

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Sat Dec 21, 2002 12:22 pm
by BackupUser
Restored from previous forum. Originally posted by pbdep.
Originally posted by MrVainSCL

Seems PB have some probs to handle events correctly! For example ComboBox, Network...

So we really need a better and correct working event handling system!

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten
Hello MrVainSCL,

Can you give an example of these? Im just currious.

Regards,
Norman.

Posted: Sun Dec 22, 2002 5:07 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hello pbdeb,
write a small program using a Cobobox with some different stuff to select... If you press the Combobox Gadget we will get an event... But now we are inside the list to select any entry... When selecting any entry Combobox will not return a new event for exampe...

Btw ask Tranquilizer, who have some Eventproblems with other stuff too.

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Sun Dec 22, 2002 5:37 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.

it seems to work fine for me?
http://www.reelmediaproductions.com/pb/ ... erv401.zip
here i use a few and all work well! or maybe im missing what you mean?

--Kale

New to PureBasic and falling in Love! :)

Posted: Sun Dec 22, 2002 6:22 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> write a small program using a Cobobox with some different stuff to
> select... If you press the Combobox Gadget we will get an event...
> But now we are inside the list to select any entry... When selecting
> any entry Combobox will not return a new event for exampe...

Yes it does... selecting anything in the code below always returns
an event... so what's the problem?

Code: Select all

If OpenWindow(0,150,150,300,200,#PB_Window_SystemMenu,"test")
  CreateGadgetList(WindowID())
  ComboBoxGadget(0,10,10,100,150,0)
  ButtonGadget(1,120,10,50,20,"test")
  For r=1 To 10 : AddGadgetItem(0,-1,Str(r)) : Next
  Repeat
    ev=WaitWindowEvent()
    If ev=#PB_Event_Gadget
      Select EventGadgetID()
        Case 0
          Debug "combo event -- selection: "+Str(GetGadgetState(0)+1)
        Case 1
          Debug "button event"
      EndSelect
    EndIf
  Until ev=#PB_Event_CloseWindow
EndIf

Posted: Sun Dec 22, 2002 9:34 pm
by BackupUser
Restored from previous forum. Originally posted by tranquil.

@PB:

Yes you are right, there are events reported but you have to to work-arrounds if you want (for eg) to open a specified window on a combogadget event. PB returns two events and thats a hazle couse the Combobox looses focus by creating the window on the first event.

This has advanteged and disadvanteges. By the way, this is not mentioned in the documentation and can made ppl ugly who uses ComboBoxes first time.

Cheers
Mike

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound

Posted: Mon Dec 23, 2002 8:45 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> PB returns two events and thats a hazle couse the Combobox looses
> focus by creating the window on the first event.

When you click the gadget, you will naturally get a click event.
When you open a new window, you naturally get a lose-focus event on
the gadget, followed immediately by a get-focus event on the window.
That's perfectly normal and expected. Events occur all the time and
it's the programmer's job, and not PureBasic's, to handle the events.

Posted: Mon Dec 23, 2002 9:10 am
by BackupUser
Restored from previous forum. Originally posted by tranquil.

Thats right PB, but some gadgets reports only one event, others more. there is no standard that I can see. Its better to report one more event as one is missing. Thats why I said you have to use workarrounds.

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound

Posted: Mon Dec 23, 2002 10:56 am
by BackupUser
Restored from previous forum. Originally posted by Berikco.
Originally posted by tranquil

Thats right PB, but some gadgets reports only one event, others more. there is no standard that I can see. Its better to report one more event as one is missing. Thats why I said you have to use workarrounds.
Yes, PB is right, its the programmer's job to handle the events, this is not a workarround. And the standard (or no Standard )is set by M$.
There are no events missed.

Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm

Posted: Mon Dec 23, 2002 6:51 pm
by BackupUser
Restored from previous forum. Originally posted by Danilo.

Code: Select all

If OpenWindow(0,150,150,300,200,#PB_Window_SystemMenu,"test")
  CreateGadgetList(WindowID())
  ComboBoxGadget(0,10,10,100,150,0)
  ButtonGadget(1,120,10,50,20,"test")
  For r=1 To 10 : AddGadgetItem(0,-1,Str(r)) : Next
  Repeat
    ev=WaitWindowEvent()
    If ev=#PB_Event_Gadget
      Select EventGadgetID()
        Case 0
          If EventType() = 1
             Debug "combo event -- selection: "+Str(GetGadgetState(0)+1)
          EndIf
        Case 1
          Debug "button event"
      EndSelect
    EndIf
  Until ev=#PB_Event_CloseWindow
EndIf
EventType() is already there, but doesnt work correct
for all Gadgets.

cya,
...Danilo

(registered PureBasic user)