Resize Windows and make scrollbar appear ? [Solved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: Resize Windows and make scrollbar appear ? [Solved]

Post by Psychophanta »

RASHAD wrote: Fri Apr 01, 2022 6:35 pm Hi Psychophanta
I hope that I just understood you correctly
After resize you can do what you want with the gadget

Code: Select all

Procedure SizeCB()
  w = WindowWidth(0)
  h = WindowHeight(0)
  ResizeGadget(0,10,10,w-20,h-20)
EndProcedure

OpenWindow(0, 0, 0, 800,600, "test",  #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget |  #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
ScrollAreaGadget(0, 10, 10, 780,580 , 2000,1500, 30)
;add some other gadgets...
CloseGadgetList()
BindEvent(#PB_Event_SizeWindow,@sizeCB())
Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow 
      Quit = 1
      
    Case #PB_Event_Gadget
      Select EventGadget()
        Case 0
          Select EventType()
            Case #PB_EventType_Resize  ;The gadget has been resized.
              SetGadgetAttribute(0, #PB_ScrollArea_X, 2000)
              hpos = GetGadgetAttribute(0, #PB_ScrollArea_X)
    
              SetGadgetAttribute(0, #PB_ScrollArea_Y, 1500)
              vpos = GetGadgetAttribute(0, #PB_ScrollArea_Y)              

              SetGadgetAttribute(0, #PB_ScrollArea_X, hpos/2)
              SetGadgetAttribute(0, #PB_ScrollArea_Y, vpos/2)
          EndSelect
      EndSelect
  EndSelect
Until Quit = 1
Again: you did not understand a thing.
Please do not try again to make to loss my time. I even uploaded a video showing it, so i think it is enought.

Thank you.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4951
Joined: Sun Apr 12, 2009 6:27 am

Re: Resize Windows and make scrollbar appear ? [Solved]

Post by RASHAD »

You are rude beside you did not understand what the event can do
RTFM carefully
Egypt my love
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: Resize Windows and make scrollbar appear ? [Solved]

Post by Psychophanta »

Dear RASHAD.
Sorry my rudeness, but please try to watch the reason of it. :o :)

Again and again you are posting tips which have nothing to do with the issue :o
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
breeze4me
Enthusiast
Enthusiast
Posts: 633
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: Resize Windows and make scrollbar appear ? [Solved]

Post by breeze4me »

The following event is supported through EventType():
#PB_EventType_Resize: The gadget has been resized.
The above explanation has the following meaning.
#PB_EventType_Resize: This event occurs when the gadget has been resized by using ResizeGadget() function.
And this does not mean that the gadget can be resized by dragging a specific part of it.

The points mentioned above apply to all gadgets of container type.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: Resize Windows and make scrollbar appear ? [Solved]

Post by Psychophanta »

breeze4me wrote: Fri Apr 01, 2022 11:42 pm
The following event is supported through EventType():
#PB_EventType_Resize: The gadget has been resized.
The above explanation has the following meaning.
#PB_EventType_Resize: This event occurs when the gadget has been resized by using ResizeGadget() function.
And this does not mean that the gadget can be resized by dragging a specific part of it.

The points mentioned above apply to all gadgets of container type.
Nope, dear.
The above explanation has NOT that meaning. :wink:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
mk-soft
Always Here
Always Here
Posts: 6231
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Resize Windows and make scrollbar appear ? [Solved]

Post by mk-soft »

I don't see any code example from you and ...

You cannot change the size of the ScrollAreaGadget with the mouse. The size of the ScrollAreaGadget can only be changed with ResizeGadget(...). This must be done in the event #PB_Event_SizeWindow. (So like in my example)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: Resize Windows and make scrollbar appear ? [Solved]

Post by Psychophanta »

mk-soft wrote: Sun Apr 03, 2022 11:16 am You cannot change the size of the ScrollAreaGadget with the mouse.
That's all Folks :!: :wink:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Post Reply