Center MsgXxx () in a not center (in desktop) form...

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Center MsgXxx () in a not center (in desktop) form...

Post by Claudio Ricardo »

Hi, I need to center the messages in the main window, so I do:

Code: Select all

// This variables declared PRIVATE at start

	cbMainCenterRow := { || ( Main.Row + ( Main.Height / 2 )) - 100 }
	cbMainCenterCol := { || ( Main.Col + ( Main.Width / 2 )) - 200 }

	Set DialogBox Row cbMainCenterRow Col cbMainCenterCol

END WINDOW
    Main.Activate
Here I assume that MsgXxx will be 200h x 400w px. and align it well, but what about short msgs ?
Is there a way to know what size the Msg window will have, to put it in the codeblock ?
Something like I do with any window: Form_xx.CenterIn ( Main ) ?
It's not something important, but it would look neater !
As always, thanks in advance for any suggestions or help.
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
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Center MsgXxx () in a not center (in desktop) form...

Post by andyglezl »

Maybe...

PadC( <xVal>, <nWidth>, <cFill> ) → cString
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Center MsgXxx () in a not center (in desktop) form...

Post by Claudio Ricardo »

Hola Andy, gracias por contestar, te refieres a rellenar con espacios el texto que mostrará el MsgXxx
para que siempre la ventana del control tenga el mismo ancho ?
Lo que deseo hacer es centrarlo en la ventana main como si fuera cualquier otra ventana en la que puedo usar:
Form_1.CenterIn ( Main )... algo asi como: Set DialogBox CenterIn ( Main )
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
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Center MsgXxx () in a not center (in desktop) form...

Post by andyglezl »

Creo que por defecto todos los MsgXxx() salen centrados en el Escritorio... :roll:
sin utilizar: Set DialogBox Row cbMainCenterRow Col cbMainCenterCol

O te refieres al tamaño de una ventana en especifico ?

Porque si se mueve la ventana, abría que estarla "siguiendo" para centrar donde esté ...

Ya probaste con esto ?

SET DIALOGBOX [ POSITION ] CENTER OF PARENT
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Center MsgXxx () in a not center (in desktop) form...

Post by Claudio Ricardo »

Muchas gracias Andy, Funcionó así: SET DialogBox Center Of Parent
sin especificar nada en [ POSITION ]
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