CheckBox Centered and Multiline text

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CheckBox Centered and Multiline text

Post 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 4835 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
Last edited by Pablo César on Mon Jan 09, 2017 9:45 am, edited 4 times in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: CheckBox Centered and Multine text

Post by serge_girard »

Thanks Pablo !

Serge
There's nothing you can do that can't be done...
User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

Re: CheckBox Centered and Multine text

Post by quartz565 »

Thank you Pablo !
Best Regards,
Nikos.

os: Windows Server 2019 - 64
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: CheckBox Centered and Multine text

Post by bpd2000 »

Nice, thank you Pablo !
BPD
Convert Dream into Reality through HMG
User avatar
Anand
Posts: 595
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: CheckBox Centered and Multiline text

Post 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
Regards,

Anand

Image
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CheckBox Centered and Multiline text

Post 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 4729 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:
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: CheckBox Centered and Multiline text

Post 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
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: CheckBox Centered and Multiline text

Post by trmpluym »

Thanks Pablo,

Very usefull...

Theo
User avatar
Anand
Posts: 595
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: CheckBox Centered and Multiline text

Post 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
Regards,

Anand

Image
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CheckBox Centered and Multiline text

Post 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.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply