Resize / AutoAdjust()

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Resize / AutoAdjust()

Post by AUGE_OHR »

hi,

i have work with AutoAdjust(), made by MigSoft / Danny / Pablo César, to resize Controls and add

LockWindowUpdate()
https://docs.microsoft.com/en-us/window ... ndowupdate

LISTVIEW_SETCOLUMNWIDTH()
https://docs.microsoft.com/en-us/window ... olumnwidth

LockWindowUpdate() does "speed-up Output"
LISTVIEW_SETCOLUMNWIDTH() is used for Column of GRID / BROWSE.

---

to enable Resize / AutoAdjust() add this to Form

Code: Select all

ON SIZE AutoAdjust( ThisWindow.Name ) 
ON MAXIMIZE AutoAdjust( ThisWindow.Name )
RESIZE.ZIP
(1.49 KiB) Downloaded 155 times
have fun
Jimmy
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Resize / AutoAdjust()

Post by Claudio Ricardo »

Hi Jimmy...
I make small demo prog... I need copy dll.ch from HB contrib to HMG Include folder
and comment or modify some lines for error when compilating or execute.
Now if i resize first, resize and maximize work fine... but not if i first maximize.
What i do bad ?
Sorry for my very bad english :oops: and Thanks in advance.
Attachments
Prueba_Autosize.zip
(1.69 MiB) Downloaded 127 times
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
mol
Posts: 3774
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Resize / AutoAdjust()

Post by mol »

The problem with this autosizing is that generates strange screens, eg. when you change width - fontsize stays the same, but when you change height of window - fontsize is changing.
In my opinion - fontsize od controls should stay unchanged, size of pictures and icons also. Only dimensions of some cotrols - like browse or grid should change
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Resize / AutoAdjust()

Post by Claudio Ricardo »

Hi Marek...
(Google trad)
I think the same as you, but the bug in the little program that I uploaded is surely due to my error.
I am now with very little free time to review or better implement it.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
serge_girard
Posts: 3308
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Resize / AutoAdjust()

Post by serge_girard »

Risize should work as good as it works in any browser (Ctrl + and Ctrl -). This means that EVERY control has to be resized....!
There's nothing you can do that can't be done...
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Resize / AutoAdjust()

Post by AUGE_OHR »

hi,

i have found c:\hmg.3.4.4\SAMPLES\Basics\MAIN_AUTOADJUST\AutoAdjust.prg and try it in my last App.
with some modification ( Font ) it seems to work fine ... but not with all App.

it seems to work fine when use *.FMG or "single-Form" but i have Problem when open "Child Form" on "Parent Form"
it might be a Problem of Semi-OOP vs. "real" OOP as it recognize "Child Form Control" just "One-Way" (minimize)

---

when "resize" it use "Zoom-Scale" on Control which work with ROW, COL, WIDTH, HEIGHT.
but with Font it might give Result of Size which does not exist so OS take "near by Font Size"

but i "think" we need to resize Font while it look funny when have "big" Control with "small" Font

---

i´m not sure about _HMG_SYSDATA. will it have "Original" Value or can this be changed :?:
my own Code use "Original" Value and "Zoom-Scale"

---

never less LockWindowUpdate() and LISTVIEW_SETCOLUMNWIDTH() seems to work find
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Resize / AutoAdjust()

Post by AUGE_OHR »

hi Claudio,
Claudio Ricardo wrote: Wed Feb 17, 2021 8:07 pm Now if i resize first, resize and maximize work fine... but not if i first maximize.
What i do bad ?
i have look into your Sample using Debugger and "think" i found it

your Intro have 2 Button but 2nd Button have a Image and no Text -> no Font -> Error resize
i "think" that is the reason why "Font resize" was not in Original at that place which i use now

i have to overthink about Image
if you want to try "more" use "Original" Source
have fun
Jimmy
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Resize / AutoAdjust()

Post by Claudio Ricardo »

Hola... Sólo tiene tu función en la ventana "Proveedores".
Hi... Only "Proveedores" window have you autosize function.

Probaré poniendole texto a los 3 botones de esa ventana y usando tu código original.
I try put text in the 3 button's on that window and you original code.
Thanks for your explanation.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Resize / AutoAdjust()

Post by AUGE_OHR »

hi,

my Error :(

i forgot to post this line

Code: Select all

ON INIT AutoAdjust( ThisWindow.Name )
to get Original Size / Pos
OnInit_Adjust.JPG
OnInit_Adjust.JPG (49.87 KiB) Viewed 1916 times
so it are 3 line to change

---

Font "Problem" when have a Image but no Text : use ELSEIF code which do not resize Font as i post it
have fun
Jimmy
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Resize / AutoAdjust()

Post by Claudio Ricardo »

Yess!!! Work fine now !!
Thank you so much !!!
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
Post Reply