The methods :GetCliRect() and :GetCliAreaRect() are doing exactly what I was looking for
Here are some posts regarding these two methods:
viewtopic.php?f=3&t=8733&p=41038&hilit=GetCliRect#p41038:
Antonio wrotes:
The buttonbar and the messagebar are also controls, in the same way as SAYs, GETs, Buttons, etc.
You just need to use oBar:nHeight and oMsgBar:nHeight to calculate the right coordinates for the other controls
When you do oWnd:oClient = oControl the FWH calculates the remaining client area automatically
viewtopic.php?f=17&t=12423&p=62355&hilit=GetCliRect#p62355:
Can you be more specific about your problem. It seams to me now, you have the same problem I as have. My question is: do you create browse from RESOURCE (.RC or .DLL) or you put it on the dialog with @ y,x commands? It is important. If I don't use resources, I can fit browse without problem, but if I use resources, then there are problems, browse doesn't fit always in the dialog! The difference arise when I change the system settings related to the font sizes! (Setup-display-settings-font size).
Try: ...
viewtopic.php?f=6&t=35139&:
lo que hace es centrar en la pantalla, no en la ventana contenedora.
A mi entender, creo que deberia de funcionar el evento Center() del ejemplo anterior, seria lo mas "correcto"
Y para centrarlo, de momento... lo hago "calculando" el ancho/alto...
- Code: Select all Expand view RUN
#include "FiveWin.ch"
function Main()
local oWnd, oChild1
Local nClientWidth
DEFINE WINDOW oWnd FROM 1,0 TO 500,800 PIXEL
nClientWidth := oWnd:GetCliAreaRect():nWidth
DEFINE WINDOW oChild1 FROM 0, (nClientWidth-250)/2 TO 0, (nClientWidth/2)+125 PIXEL OF oWnd
oChild1:nHeight := oWnd:GetCliAreaRect():nHeight
oChild1:Show()
ACTIVATE WINDOW oWnd
Return nil
Conclusions:
:GetCliRect() - returns an oRect with the relative gross coordinates, mean including the menu (SM_CYMENU), button and message bar,...
:GetCliAreaRect() - returns an oRect with the relative net coordinates, mean excluding the menu, button and message bar,...
Both oRect excluded the window title (SM_CYCAPTION) and frame (SM_CYDLGFRAME, SM_CYDLGFRAME)
Any comments or corrections