home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
215
/
DDJ11A92.ZIP
/
CPPLIB.ASC
< prev
next >
Wrap
Text File
|
1992-10-29
|
1KB
|
72 lines
_DEVELOPING A PORTABLE C++ GUI CLASS LIBRARY_
by Andreas Meyer
Example 1:
class MyDialog : public ModalDialog
{
protected:
DefPushButton aOkButton;
public:
MyDialog( Window* pParent );
void QuitDialog( DefPushButton* pButton );
}
MyDialog::MyDialog( Window* pParent ) :
ModalDialog( pParent ),
aOkButton( this )
{
aOkButton.ChangeClickHdl( LINK( this, MyDialog::QuitDialog ) );
}
void MyDialog::QuitDialog( DefPushButton* pButton )
{
if( ... ) // check dialog state
ModalDialog::EndDialog();
}
Example 2:
(a)
class Object
{
Object GetNext();
}
if( bTest && ( aObj.GetNext() == aObj ) ) ...
(b)
Obj aNext = aObj.GetNext();
if( bTest && ( aNext == aObj ) ) ...
Example 3:
(a)
#define CONCAT( a, b ) a##b
CONCAT( A, B ) // this will throw an error
(b)
#define CONCAT( a, b ) a/**/b
Example 4:
class Base
{
~Base() { foo(); }
virtual foo();
}
class Derived : public Base
{
virtual foo();
}