About box

About box

Postby HunterEC » Mon Jul 04, 2011 8:29 am

Guys:

What would be the easiest way to build an about box for a program ? Alert, a dialog, MsgInfo, etc ? I'd tried using a Dialog and the CENTER() function for each SAY but the text does not get centered. Any ideas ? Thank you.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: About box

Postby ukoenig » Mon Jul 04, 2011 9:53 am

I think a VTitle can do the Job :

Image



@ 15, 15 BUTTON "&About" SIZE 100,50 OF oWnd1 PIXEL ;
FONT oFont1 ;
ACTION SHOW_TITLE(oWnd1, 100, 100)

// -----------------

FUNCTION SHOW_TITLE(oContrl, nTop, nLeft)
Local oBar1

@ nTop, nLeft TITLE oBar1 size 300, 80 of oContrl SHADOW BOTTOMLEFT SHADOWSIZE 10 BOTTOMRIGHT

@ 10, 20 TITLEIMG OF oBar1 BITMAP c_path + "\Bitmaps\Info.bmp" SIZE 45, 45 ANIMA LEVEL 255 ;
ACTION ( NIL) // can have a Action !!!

@ 20, 100 TITLETEXT OF oBar1 TEXT "About-message" FONT oFont1 COLOR 128
@ 40, 100 TITLETEXT OF oBar1 TEXT "Testing Windows and Dialogs" FONT oFont1 COLOR 128

oBar1:lRound := .T.
oBar1:aGrdBack := { { 0.95, 14853684, 16314573 },{ 0.95, 16314573, 14853684 } }


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: About box

Postby HunterEC » Mon Jul 04, 2011 4:32 pm

Uwe:

Thank you for your answer. The compiler gives me an error with the @ nTop, nLeft TITLE, TITLEIMG, TITLETEXT commands. I'm using FWH 10.6. Can the TITLE control be centered no matter the screen resolution ? Thank you my friend.


Gustavo
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: About box

Postby nageswaragunupudi » Mon Jul 04, 2011 5:02 pm

There is a built-in FWH function
MsgAbout( cAbout, cCopyRight )

This function uses the standard Microsoft Windows About dialog, which looks like any other standard about dialog of other windows software.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: About box

Postby HunterEC » Mon Jul 04, 2011 5:20 pm

Rao:

Thank you for your response. Can MsgAbout() display more than one line ?
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: About box

Postby hua » Tue Jul 05, 2011 2:02 am

I don't know whether it differs by region but MsgAbout() on my PC would show everything belongs to Microsoft. Clicking on the End-User License Agreement seems to bring up standard Microsoft's EULA. Might be better to spend some time and write your own About dialog box for full control.

Image
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: About box

Postby HunterEC » Tue Jul 05, 2011 8:45 am

Hua:

Thank you for your response. Same results here. :(
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: About box

Postby ukoenig » Tue Jul 05, 2011 9:29 am

In case, You agree with a VTitle-solution, just give me a little bit Time
and we will have a nice visual painter for it, that will create a working EXE-file of the Results.
The Message will have a Headline, Image and up to 5 Textlines.
You can test the Message on any Position and Window-background.
The Main-window includes a Painter-button, that will open a Dialog to do all needed Settings / Selections.
It can be used as a Message-editor for any Message You need.

Includes :

Window- and About (VTitle)-background-painter
About(VTitle)-settings like Size, BMP-selection, Text, ...
Font-painter

Image

Image

Some more Options added :

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Tue Jul 05, 2011 10:00 pm, edited 1 time in total.
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: About box

Postby HunterEC » Tue Jul 05, 2011 8:16 pm

Uwe:

Great idea and visuals ! I can't wait to test your solution. :D

PD.: Does the @ x,y TITLE, TITLEIMB, TITLETXT works in FWH 10.06 or do I have to upgrade ?
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: About box

Postby ukoenig » Tue Jul 05, 2011 8:54 pm

Gustavo,

I think Your Version will work 10.6
Have a look at : \samples\testtitl.prg

Last changes of VTiles 10.4 :

April 2010
==========
.....
.....

* New: Class TTitleText to use in class TTITLE, create an object with the properties of the text added to TTITLE
* New: Class TTitleImg to use in class TTITLE, create an object with properties of the image added to TTITLE
modified xcommand, TITLEIMG and TITLETEXT to return the object created in each case

All Styles are working :

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Wed Jul 06, 2011 9:28 am, edited 1 time in total.
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: About box

Postby HunterEC » Tue Jul 05, 2011 10:11 pm

Uwe:

The first example worked ok. Now, how do I close the Vtitle ? Thank you.


PD: Your prototypes look awesome !
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: About box

Postby ukoenig » Tue Jul 05, 2011 10:25 pm

Gustavo,

Include a Button to the Function.
The Position is calculated to the Right- / Bottom-corner :

@ nHeight - 40, nWidth - 45 BUTTON "&OK" SIZE 40,30 OF oBar1 PIXEL ;
FONT oFont1 ;
ACTION oBar1:End()


In case You don*t want a extra Button, You can use the ACTION of the Info.bmp :
( It would be great, Daniel could add TOOLTIPS to the Image )

@ 10, 20 TITLEIMG OF oBar1 BITMAP c_path + "\Bitmaps\Info.bmp" SIZE 45, 45 ANIMA LEVEL 255 ;
ACTION oBar1:End() // can have a Action !!!

Just give You a Idea. Using a Logo as Background and NO extra Bmp.

Image

The Painter :

You can change everything :
Fonts and Text, Backgrounds, Sizes, Message-Bmp, Shadow- Size / Position / Color .....
Switch BMP On / Off, to show just the Background and Text.
Empty Textlines are not used inside the Message.
Any Changes from the Folder, shows the Result inside the Painter.
The Window-message is updated, after closing the Painter.
Message-Top/Left is fixed to the left upper Corner.

Calculated Top-textlinepositions from given distance (nTextT) and Fonthight (nFontH1 and nFontH2)
Local nTop1 := 2 * nTextT + nFontH1 // Top of 1. Textline uses Hight of Headline-font
Local nTop2 := 3 * nTextT + 2 * nFontH2 // Top of 2. Textline
Local nTop3 := 4 * nTextT + 3 * nFontH2 // Top of 3. Textline
Local nTop4 := 5 * nTextT + 4 * nFontH2 // Top of 4. Textline
Local nTop5 := 6 * nTextT + 5 * nFontH2 // Top of 5. Textline

Image

Change the Text and define a Dialog-size for the Dialog-preview :

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: About box

Postby HunterEC » Thu Jul 07, 2011 4:45 am

Uwe:

Great job ! How can I download the painter ?
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: About box

Postby ukoenig » Thu Jul 07, 2011 12:14 pm

Gustavo,

there is still something to do.
As more time I work on it, I getting more and more Ideas.
Funny Things can be done.
I think it will be ready next week for Download.
There will be a extra Toppic < Message paint >
I think without a visual Preview in Realtime, it would be a hard Job, to get the desired Result.

In the meantime another Preview from the Image / brush-section :
You can Resize the Logo to a Size from 20 - 70 Pixel ( also a Logo could be a Message-background ).
A < 0 > Value shows the original Size.

Image

Image

The Logo used before as Background with another Logo on Top / left-corner and changed Text :
I could show the small Logo-preview transparent, but I want to show a used Alpha-channel ( Black Background )

Image

I finished the Color-section :

Image

Added a new Option BASE ( there is no extra work ) :

must be selected as a Option from the Message-background.
only 2 extra Lines needed :

1.
@ nTop, nLeft TITLE oBar1 SIZE nWidth, nHeight OF oContrl TRANSPARENT BORDER BASE SHADOWSIZE 0

2.
oBar1:aGrdBase := { { nGradPos, nColor1, nColor2 } , ;
{ 10 - nGradPos, nColor2, nColor1 } }


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: Google [Bot] and 104 guests