September 19, 2021, 09:39:17

Author Topic: Maxgui how i can enlarge a window?  (Read 358 times)

Offline fielder

  • Full Member
  • ***
  • Posts: 109
Maxgui how i can enlarge a window?
« on: August 13, 2021, 09:03:17 »
how i can enlarge a window created by
Code: [Select]
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
« Last Edit: August 13, 2021, 09:06:26 by fielder »

Offline Midimaster

  • Sr. Member
  • ****
  • Posts: 363
    • Midimaster Music Education Software
Re: Maxgui how i can enlarge a window?
« Reply #1 on: August 13, 2021, 09:37:46 »
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:
Code: [Select]
....
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
« Last Edit: August 13, 2021, 09:43:38 by Midimaster »
See my current project on PlayStore: 20Tracks-Audio-Player https://play.google.com/store/apps/details?id=midimaster.twentytrackd

Offline fielder

  • Full Member
  • ***
  • Posts: 109
Re: Maxgui how i can enlarge a window?
« Reply #2 on: August 13, 2021, 10:05:58 »
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]
« Last Edit: August 13, 2021, 10:33:14 by fielder »

Offline Midimaster

  • Sr. Member
  • ****
  • Posts: 363
    • Midimaster Music Education Software
Re: Maxgui how i can enlarge a window?
« Reply #3 on: August 13, 2021, 11:10:28 »
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
Code: [Select]
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
See my current project on PlayStore: 20Tracks-Audio-Player https://play.google.com/store/apps/details?id=midimaster.twentytrackd

Offline fielder

  • Full Member
  • ***
  • Posts: 109
Re: Maxgui how i can enlarge a window?
« Reply #4 on: August 16, 2021, 08:43:20 »
thank you very much :)

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal