How to create a multiline button?

Post Reply
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

How to create a multiline button?

Post by hag »

Any code available to create a multiline button?

Useing resources..Borland workshop.

Thanks
Thank you
Harvey
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: How to create a multiline button?

Post by ukoenig »

A sample :

REDEFINE BTNBMP oBtn ID 10 OF oFld1:aDialogs[1] 2007 ;
FILENAME c_path + "\Images\select.bmp" ;
LEFT ;
PROMPT " &Select " + CRLF + "Test" ;
FONT oBtnFont ;
ACTION MY_ACTION()
oBtn:lTransparent = .t.
oBtn:cTooltip := { "Select the 1. " + CRLF + "Color for " + CRLF + ;
"Gradient-Design","Color-Select", 1, CLR_BLACK, 14089979 }

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: How to create a multiline button?

Post by hag »

Uwe

Thanks for the quick response but not sure the code works with my code

Code: Select all | Expand


   REDEFINE BUTTON oBtn2 Id 4002 OF ODLG2 ;     
   action(oDlg2:End())


If I change it to:

Code: Select all | Expand


 
 REDEFINE BUTTON oBtn2 prompt "&select"+CRLF+"test" Id 4002 OF ODLG2 ;                 
   action(oDlg2:End())


it doesn't work.
Thank you
Harvey
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: How to create a multiline button?

Post by ukoenig »

We have 3 Button-Classes :

Button
ButtonBMP and
BtnBMP

Class Button doesn't support Linefeed.

For BtnBmp You can use a Resource for Resource-Workshop like:
CONTROL "", 804, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 181, 211, 31, 12

My new Buttontool supports all 3 Styles.
Maybe a good Idea, to support Multiline-Prompts ( Linefeed ) as well.

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: How to create a multiline button?

Post by hag »

Thanks again...I'll try it tomorrow and let you know.
Thank you
Harvey
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: How to create a multiline button?

Post by ukoenig »

My Solution for the Tools :
It is easy now, to test Multiline Prompts.
A activated Checkbox will force a CRLF between the 2 Gets,
otherwise the first get is trimmed + 1 char Space + the 2. Get in 1 Line.

Image

A easy way to test, if Buttonsize, Bitmap and Fontsize work together.

Image


Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: How to create a multiline button?

Post by Enrico Maria Giordano »

hag wrote:Any code available to create a multiline button?


This is a working sample:

Code: Select all | Expand

#include "Fivewin.ch"


#define CR CHR( 13 )

#define BS_MULTILINE 8192


FUNCTION MAIN()

    LOCAL oDlg, oBtn

    DEFINE DIALOG oDlg

    @ 1, 1 BUTTON oBtn PROMPT "&Close" + CHR( 13 ) + "the dialog";
           SIZE 50, 30;
           ACTION oDlg:End()

    oBtn:nStyle = NOR( oBtn:nStyle, BS_MULTILINE )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: How to create a multiline button?

Post by ukoenig »

Enrico,

I wanted to include Your Solution to the other
Tests of the Tools ( Button and ButtonBMP of the ButtonSkin-part ).
Is it possible, to use it for Resources to ?
I don't get it working.

REDEFINE BUTTON oBtn5 PROMPT TRIM(aBTNTEXT[5][1]) + CHR( 13 ) + "Multiline-Test" ID 210 OF oDlg70
oBtn5:oFont := oTextFont
oBtn5:nStyle = NOR( oBtn5:nStyle, BS_MULTILINE )

Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: How to create a multiline button?

Post by Enrico Maria Giordano »

You have to add 8192 as button style in the resource.

EMG
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: How to create a multiline button?

Post by hag »

enrico

Thanks for the solution on the multiline button.
Its not working..using borland resources.
You indicated to uwe to add 8192 as a resource style.
Can you explain how to do that.

Went into the text of the dialog to edit style change but can't figure out how to do it on the button.
You additional help woild be appreciated.
Thank you
Harvey
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: How to create a multiline button?

Post by Enrico Maria Giordano »

As an example:

Code: Select all | Expand

PUSHBUTTON "", 201, 10, 10, 65, 40, BS_MULTILINE | WS_TABSTOP


EMG
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: How to create a multiline button?

Post by hag »

Enrico
Perfect.
Needed to edit the rc file outside of borland.
Borland doesn't compile properly with the code you provided.

But it works great.

Thanks again.
Thank you
Harvey
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: How to create a multiline button?

Post by Enrico Maria Giordano »

Just use

Code: Select all | Expand

PUSHBUTTON "", 201, 10, 10, 65, 40, 8192 | WS_TABSTOP


and it will compile fine.

EMG
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: How to create a multiline button?

Post by ukoenig »

Enrico,

with normal ButtonStyle it works fine.
Using a ButtonSkin, it doesn't work.

Image

Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
Post Reply