How to create a multiline button?

How to create a multiline button?

Postby hag » Sat Jan 09, 2010 11:29 pm

Any code available to create a multiline button?

Useing resources..Borland workshop.

Thanks
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: How to create a multiline button?

Postby ukoenig » Sun Jan 10, 2010 12:08 am

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to create a multiline button?

Postby hag » Sun Jan 10, 2010 12:38 am

Uwe

Thanks for the quick response but not sure the code works with my code
Code: Select all  Expand view  RUN

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


If I change it to:

Code: Select all  Expand view  RUN

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


it doesn't work.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: How to create a multiline button?

Postby ukoenig » Sun Jan 10, 2010 12:46 am

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to create a multiline button?

Postby hag » Sun Jan 10, 2010 12:59 am

Thanks again...I'll try it tomorrow and let you know.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: How to create a multiline button?

Postby ukoenig » Sun Jan 10, 2010 1:19 am

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to create a multiline button?

Postby Enrico Maria Giordano » Sun Jan 10, 2010 11:20 am

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


This is a working sample:

Code: Select all  Expand view  RUN
#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
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: How to create a multiline button?

Postby ukoenig » Sun Jan 10, 2010 12:04 pm

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to create a multiline button?

Postby Enrico Maria Giordano » Sun Jan 10, 2010 12:56 pm

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

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

Re: How to create a multiline button?

Postby hag » Sun Jan 10, 2010 5:48 pm

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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: How to create a multiline button?

Postby Enrico Maria Giordano » Sun Jan 10, 2010 5:54 pm

As an example:

Code: Select all  Expand view  RUN
PUSHBUTTON "", 201, 10, 10, 65, 40, BS_MULTILINE | WS_TABSTOP


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

Re: How to create a multiline button?

Postby hag » Sun Jan 10, 2010 7:28 pm

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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: How to create a multiline button?

Postby Enrico Maria Giordano » Sun Jan 10, 2010 8:53 pm

Just use

Code: Select all  Expand view  RUN
PUSHBUTTON "", 201, 10, 10, 65, 40, 8192 | WS_TABSTOP


and it will compile fine.

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

Re: How to create a multiline button?

Postby ukoenig » Mon Jan 11, 2010 1:19 pm

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests