Checkbox alignment not correct

Checkbox alignment not correct

Postby Patrick Mast » Sun Oct 07, 2007 3:00 pm

Hello,

Please look at following small test application:
Image
Notice that the alignment for the chekboxes are not correct.

This is the PRG part of the reduced sampe to show this:
Code: Select all  Expand view
#include "FiveWin.ch"

#define CLR_GREY       14342874
#define CLR_WHITE      16777215

Function wfMain()
   LOCAL oDlg, oRadio, lRadio:=.F.
   
   DEFINE DIALOG oDlg NAME "TEST_DIALOG"         
     
   REDEFINE RADIO oRadio VAR lRadio ID 101 OF oDlg COLOR 0, CLR_WHITE
   REDEFINE RADIO oRadio VAR lRadio ID 102 OF oDlg COLOR 0, CLR_WHITE
                                     
   ACTIVATE DIALOG oDlg CENTERED RESIZE16
   
   
RETURN NIL


And this is the RC part:
Code: Select all  Expand view
TEST_DIALOG DIALOG 21, 51, 271, 121
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Test Dialog"
FONT 8, "MS Sans Serif"
{
CHECKBOX "Checkbox Right", 102, 16, 32, 90, 14, BS_AUTOCHECKBOX | WS_TABSTOP
CHECKBOX "Checkbox Left :", 101, 17, 16, 80, 14, BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP
}


For your convenience I have ZIP'ed both files into this file:
http://www.WinFakt.be/Ckeckbox_Aligment.zip

Thank you.

Patrick Mast
http://www.winfakt.be
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Re: Checkbox alignment not correct

Postby Enrico Maria Giordano » Sun Oct 07, 2007 3:22 pm

Code: Select all  Expand view
CHECKBOX "Checkbox Right", 102, 16, 32, 80, 14, BS_AUTOCHECKBOX | WS_TABSTOP
CHECKBOX "Checkbox Left :", 101, 16, 16, 80, 14, BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8356
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Checkbox alignment not correct

Postby Patrick Mast » Sun Oct 07, 2007 3:34 pm

EnricoMaria wrote:
Code: Select all  Expand view
CHECKBOX "Checkbox Right", 102, 16, 32, 80, 14, BS_AUTOCHECKBOX | WS_TABSTOP
CHECKBOX "Checkbox Left :", 101, 16, 16, 80, 14, BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP


EMG


Not so simple Enrico ;-)

As we do not know what string we will be using for the checkbox. So, the same RC will be used for a checkbox named like "This is a checkbox here" and the other time it will be called for example "test". So, we set the width to the max we can do for that dialog. The checkbox should align the text just next to the checkbox itself.

Running test.exe should look like this no?
Image

Patrick Mast
http://www.winfakt.be
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Re: Checkbox alignment not correct

Postby Enrico Maria Giordano » Sun Oct 07, 2007 4:44 pm

Sorry Patrick but I really don't understand your problem.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8356
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Sun Oct 07, 2007 6:15 pm

Patrick,

It seems you defined them as checkboxes in the RC then redefined them as radios in your code. What that intentional, and if so, why?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Patrick Mast » Sun Oct 07, 2007 6:54 pm

James Bott wrote:Patrick,

It seems you defined them as checkboxes in the RC then redefined them as radios in your code. What that intentional, and if so, why?
James


Oops, that's a TYPO.. Damned, sorry. But the problem remains, the text of the checkboxes should be RIGHT or LEFT aligned.

Patrick
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Re: Checkbox alignment not correct

Postby Patrick Mast » Sun Oct 07, 2007 6:55 pm

EnricoMaria wrote:Sorry Patrick but I really don't understand your problem.
EMG


Simple, if I use a checkbox RIGHT aligned (So that the checkbox is on the RIGHT hand side of the text), the text should ALSO e right aligned, and not left.

Patrick
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby James Bott » Sun Oct 07, 2007 7:06 pm

Patrick,

>Simple, if I use a checkbox RIGHT aligned (So that the checkbox is on the RIGHT hand side of the text), the text should ALSO e right aligned, and not left.

You say it "should be" but I am not sure. Is this because this is the way you would like it to be, or because this is the way other Windows apps are showing? Because this is a Windows common control, we are limited as to how it works. Can you show us an example from another application where the checkbox is being displayed the way you think it should be? Or, are all other apps displaying it the same way as FWH?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Checkbox alignment not correct

Postby Enrico Maria Giordano » Sun Oct 07, 2007 8:58 pm

Patrick Mast wrote:Simple, if I use a checkbox RIGHT aligned (So that the checkbox is on the RIGHT hand side of the text), the text should ALSO e right aligned, and not left.

Patrick


As James suspected, this is not how Windows checkboxes work.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8356
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 27 guests