Page 1 of 1

ScrollAreaG. won't scroll if gadgets inside fill it

Posted: Mon Feb 22, 2010 4:07 pm
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.

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

Posted: Tue Feb 23, 2010 3:04 pm
by DarkDragon
Wait, can someone tell me how to change the cursor on that imagegadget when its disabled, at least for windows?

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

Posted: Tue Feb 23, 2010 7:23 pm
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

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

Posted: Wed Feb 24, 2010 2:59 pm
by DarkDragon
Thanks! :D