Back
1 //------------------------------------------------------------------------------
2 // module: FAbout.h //
3 // //
4 // About-dialog with a few lines of text and an animated icon playing //
5 // pinball with the dialogs frame. //
6 // //
7 // Copyright (c) 2000-2004 by Lars Haendel //
8 // home: http://www.newty.de //
9 // //
10 // This program is free software; you can redistribute it and/or modify //
11 // it under the terms of the GNU General Public License as published by //
12 // the Free Software Foundation as version 2 of the License. //
13 // //
14 // This program is distributed in the hope that it will be useful, //
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
17 // GNU General Public License for more details. //
18 // //
19 // You should have received a copy of the GNU General Public License //
20 // along with this program; if not, write to the Free Software //
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
22 // //
23 //------------------------------------------------------------------------------
24
25
26 #ifndef FAboutH
27 #define FAboutH
28
29 #include <Classes.hpp>
30 #include <Controls.hpp>
31 #include <StdCtrls.hpp>
32 #include <Forms.hpp>
33 #include <ExtCtrls.hpp>
34 #include <AppEvnts.hpp>
35
36
37 //-------------------------------------------------------------------------------------------
38 // about-dialog - important: deletes itselfs when closed. thus do not autocreate it!
39 class TFAbout : public TForm
40 {
41 __published:
42 TTimer *Timer;
43 TLabel *LaPurpose;
44 TLabel *LaWrittenBy;
45 TLabel *Label3;
46 TLabel *LaVisitUrl;
47 TLabel *Label5;
48 TLabel *Label8;
49 TLabel *Label9;
50 TLabel *Label10;
51 TLabel *Label11;
52 TLabel *Label12;
53 TLabel *Label13;
54 TLabel *Label14;
55 TLabel *Label16;
56 TLabel *Label17;
57 TImage *Image;
58 TLabel *Label19;
59 TLabel *Label1;
60
61 void __fastcall OnTimer (TObject *Sender);
62 void __fastcall OnClose (TObject *Sender, TCloseAction &Action);
63 void __fastcall UrlClick (TObject *Sender);
64 void __fastcall FormShow(TObject *Sender);
65 void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
66 TShiftState Shift);
67
68 private:
69
70 //------------------------------------------------------------------------------------------
71 // struct to wrap the window-handle to be able to pass it by pointer to a thread-function
72 struct THandleWrap
73 {
74 HWND hwnd;
75 } wrapper;
76
77 // thread functions
78 friend void OpenURL (void* _tmp);
79
80
81 TPicture *icon1, *icon2; // the two icons for the animation ;-)
82 TPanel *panel; // panel in which the image with the icon is displayed
83
84 int xIcon, yIcon; // icon position and ...
85 float directionPhi; // ... moving direction
86 int cxIcon, cyIcon; // size of an icon, usually 32x32
87
88
89 // counter which is used to count the number of timer-events after reflection
90 int nSmile;
91
92 // the panel's WindowProc() function is exchanged to eliminate the WM_ERASEBKGND message
93 Controls::TWndMethod OldWindowProc; // pointer to old function
94 void __fastcall NewWindowProc(TMessage& msg); // new one
95
96 public:
97
98 // constructor/destructor
99 __fastcall TFAbout(TComponent* Owner, const AnsiString& szName, const AnsiString& szDir);
100 };
101 extern PACKAGE TFAbout *FAbout;
102 #endif
Top |