ScrollAreaG. won't scroll if gadgets inside fill it

Everything else that doesn't fall into one of the other PB categories.
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

ScrollAreaG. won't scroll if gadgets inside fill it

Post by DarkDragon »

Hello,

Can you tell me how I can (at least for windows, but linux would be fine too) set the focus for the scrollareagadget when the imagegadget is clicked? I tried sending WM_LBUTTONDOWN/UP and using SetFocus/SetActiveGadget but nothing helps:

Code: Select all

If OpenWindow(0, 0, 0, 305, 140, "ScrollAreaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  CreateImage(0, 269, 300)

  ScrollAreaGadget(0, 10, 10, 290, 120, 269, 300, 30)
  ImageGadget(1, 0, 0, 269, 300, ImageID(0))
  CloseGadgetList()
  
  Repeat
    Event = WaitWindowEvent()
    Select Event
      Case  #PB_Event_CloseWindow
        End
    EndSelect
  ForEver
EndIf
Or how can I make a GadgetOutput() for Windows and Linux?

[EDIT]

Ahhhh I've found it out:
DisableGadget(1, 1)
helps and you can scroll again.
Last edited by DarkDragon on Tue Feb 23, 2010 4:28 pm, edited 1 time in total.
bye,
Daniel
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: [solved] ScrollAreaG. won't scroll if gadgets inside fill it

Post by DarkDragon »

Wait, can someone tell me how to change the cursor on that imagegadget when its disabled, at least for windows?
bye,
Daniel
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 5046
Joined: Sun Apr 12, 2009 6:27 am

Re: ScrollAreaG. won't scroll if gadgets inside fill it

Post by RASHAD »

Hi
I hope it is OK

Code: Select all

Procedure IsMouseOver(wnd)
    GetWindowRect_(wnd,re.RECT) 
    GetCursorPos_(pt.POINT) 
    Result = PtInRect_(re,pt\y<<32+pt\x) 
    ProcedureReturn Result 
EndProcedure

If OpenWindow(0, 0, 0, 305, 140, "ScrollAreaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  CreateImage(0, 269, 300)

  ScrollAreaGadget(0, 10, 10, 290, 120, 269, 300, 30)
  ImageGadget(1, 0, 0, 269, 300, ImageID(0))
  CloseGadgetList()
  cursor0 = LoadCursor_(0,#IDC_NO)
  GadgetState = 1
  DisableGadget(1,GadgetState)
  Repeat
    If GadgetState = 1 And IsMouseOver(GadgetID(1))
        SetCursor_(cursor0)
    EndIf
    Event = WaitWindowEvent()
    Select Event
      Case  #PB_Event_CloseWindow
        End
    EndSelect
  ForEver
EndIf
Egypt my love
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: ScrollAreaG. won't scroll if gadgets inside fill it

Post by DarkDragon »

Thanks! :D
bye,
Daniel
Post Reply