Page 1 of 2

CheckBox Centered and Multiline text

Posted: Sun Jan 08, 2017 3:32 pm
by Pablo César
Hi all,

When more available space is not enough for text in CheckBoxes and as default in one line the text is cutted off... :?
Screen45.png
Screen45.png (7.63 KiB) Viewed 5328 times
We can use this:

Code: Select all

#include <hmg.ch>

#define BS_MULTILINE         8192
#define BS_CENTER            768

Function Main()
DEFINE WINDOW Demo AT 426, 890 WIDTH 215 HEIGHT 256 TITLE "CheckBox Multiline" MAIN NOMAXIMIZE NOMINIMIZE NOSIZE 

    DEFINE CHECKBOX Check_1
		ROW    25
        COL    30
        WIDTH  150
        HEIGHT 42
        CAPTION "CheckBox Centered and Multine Item"
        VALUE .F.
        FONTNAME "Arial"
        FONTSIZE 9
		FONTBOLD .T.
		BACKCOLOR {180,180,180}
        FONTCOLOR {128,0,0}
		TRANSPARENT .F.
    END CHECKBOX
	
	DEFINE CHECKBOX Check_2
	    ROW    95
        COL    30
        WIDTH  150
        HEIGHT 42
		CAPTION "CheckBox Centered and Multine Item"
        VALUE .F.
        FONTNAME "Arial"
        FONTSIZE 9
		FONTBOLD .T.
		BACKCOLOR {180,180,180}
        FONTCOLOR {128,0,0}
		TRANSPARENT .F.
    END CHECKBOX
	
	DEFINE CHECKBOX Check_3
	    ROW    165
        COL    30
        WIDTH  150
        HEIGHT 42
		CAPTION "CheckBox Centered "+CRLF+"   and Multine Item"
        VALUE .F.
        FONTNAME "Arial"
        FONTSIZE 9
		FONTBOLD .T.
		BACKCOLOR {180,180,180}
        FONTCOLOR {128,0,0}
		TRANSPARENT .F.
    END CHECKBOX

END WINDOW
Demo.Center

HMG_ChangeWindowStyle ( GetControlHandle("Check_2","Demo"), BS_MULTILINE+BS_CENTER, NIL, .F. ) // MULTILINE
HMG_ChangeWindowStyle ( GetControlHandle("Check_3","Demo"), BS_MULTILINE+BS_CENTER, NIL, .F. ) // MULTILINE

Demo.Activate
Return Nil
I hope this would be useful for you and be for fan. :D

Re: CheckBox Centered and Multine text

Posted: Sun Jan 08, 2017 3:34 pm
by serge_girard
Thanks Pablo !

Serge

Re: CheckBox Centered and Multine text

Posted: Sun Jan 08, 2017 4:37 pm
by quartz565
Thank you Pablo !

Re: CheckBox Centered and Multine text

Posted: Mon Jan 09, 2017 3:48 am
by bpd2000
Nice, thank you Pablo !

Re: CheckBox Centered and Multiline text

Posted: Mon Jan 09, 2017 10:00 am
by Anand
Really useful when needed. Thanks Pablo.

BTW can we have "Copy" along with "Select ALL" for code ? You see one has to right click and copy each time, so a direct copy to clipboard will be very useful. I have seen it in some forums though, so there must be a way for it.

Regards,

Anand

CheckBox Centered and Multiline text

Posted: Mon Jan 09, 2017 11:07 am
by Pablo César
Thank you all for your expressed interest in this topic.
Glad to know it will be useful to you. :)

Anand wrote:BTW can we have "Copy" along with "Select ALL" for code ? You see one has to right click and copy each time, so a direct copy to clipboard will be very useful. I have seen it in some forums though, so there must be a way for it.
Hi Anand,

I'm not sure what you're talking about: whether it's the CheckBox or the forum editing features regarding your question about "Select ALL". :?

1. If your question is about CheckBox. It has a way to put the text of each item in the ClipBoard, but this the user can do and in several ways.

2. If your question is about the forum features. Note that to select the whole code and copy it to the clipboard just click on "SELECT ALL" and then with the right mouse click on the selected text and with left click on the "Copy" option.
Screen46.png
Screen46.png (9.97 KiB) Viewed 5222 times
But this last, if is this your case and I also agree with you to have an extra option or modified option, you should post it at Forum help, right ?
Then your question may be responded by Mr. Rathinagiri.

Sorry to tell you but this makes confusions... :oops:

Re: CheckBox Centered and Multiline text

Posted: Mon Jan 09, 2017 2:06 pm
by EduardoLuis
Hi Pablo:

First your experiment is excellent, very very usefull.-
I've test mergin both of your checkbox new properties:
Center and multiline with left text alligment and works fine (perfect).-
Thanks for share.-
Eduardo

Re: CheckBox Centered and Multiline text

Posted: Mon Jan 09, 2017 3:28 pm
by trmpluym
Thanks Pablo,

Very usefull...

Theo

Re: CheckBox Centered and Multiline text

Posted: Mon Jan 09, 2017 4:48 pm
by Anand
Pablo César wrote:2. If your question is about the forum features. Note that to select the whole code and copy it to the clipboard just click on "SELECT ALL" and then with the right mouse click on the selected text and with left click on the "Copy" option.

But this last, if is this your case and I also agree with you to have an extra option or modified option, you should post it at Forum help, right ?
Then your question may be responded by Mr. Rathinagiri.

Sorry to tell you but this makes confusions... :oops:
Thanks Pablo, yes I meant that.
I have posted the same in "Forum Help" Sorry for the confusion.

Regards,

Anand

CheckBox Centered and Multiline text

Posted: Mon Jan 09, 2017 6:28 pm
by Pablo César
You're welcome guys.
Anand wrote:I have posted the same in "Forum Help" Sorry for the confusion.
Good man, Maybe Rathinagiri can do something to improve this.