Maxgui how i can enlarge a window?

Started by fielder, August 13, 2021, 09:03:17

Previous topic - Next topic

fielder

how i can enlarge a window created by
MainWindow:TGadget = CreateWindow(AppTitle ,0,0,460+190,170,Null,WINDOW_TITLEBAR| WINDOW_CENTER | WINDOW_ACCEPTFILES)

i need to enlarge orizzontally this created window after a while (maintaing the content)

thank you in advance.

i tried with SetGadgetShape ( MainWindow , 0 , 0 , 460+190 , 170) (but the windows is not refreshing anymore

Midimaster

#1
The command is correct. The window will already change its size, or?

What do you means with "...but the windows is not refreshing anymore"?

If you change the windows size you have to care yourself about the content is changing too. What is your content? A Canvas? A lot of buttons, etc??? Do you want to re-arrange them, or getting bigger to?

Please descripe detailed how should the content change in this moment?

Here are some code line from one of my apps:
....
SetGadgetShape Mdi.Window,GadgetX(mdi.window),GadgetY(mdi.window), NewWidth, NewHeight

SetGadgetLayout mdi.Canvas , 1,1,1,1
SetGadgetShape MDI.Canvas, 0 , 0 , GadgetWidth(mdi.Window) , GadgetHeight(mdi.Window)
RedrawGadget mdi.canvas

HellBalkenX=GadgetWidth(Mdi.Window)-350
AntwortButtonX=GadgetWidth(Mdi.Window)-200
ArrangeButtons EditMethode
...on the way to Egypt

fielder

#2
thank you midimaster (the refreshing issue is that the content is deleted (i add contents updating with FLIP) but this is not a issue.. i can redraw entire window...

BUT

how i can obtain previous window position (x-y on screen) to place the updated window in the same position?
because when i resize the window the updated one is moved to 0-0 (x-y) coords of screen :(


[EDIT]
ok...sorry not added this:   GadgetX(mdi.window),GadgetY(mdi.window)   
[/EDIT]

Midimaster

you only need to update content, when it is drawn on a canvas. So a sizing of the window need a sizing of the canvas too. and of course you have to force a re-drawing.

That what i force with the command RedrawGadget canvas. This causes an additional event
While WaitEvent()
   Select EventID()
Case EVENT_KEYDOWN
....
  Case EVENT_TIMERTICK
TimerTickt()

    Case EVENT_GADGETPAINT
PaintAll
    ....
wend

Function PaintAll()
SetGraphics CanvasGraphics(Canvas)
Cls
DrawRect....
....
Flip 0
End Function


Function TimerTickt()
PaintAll
End Function
...on the way to Egypt

fielder