From: andrew7 <bd...@us...> - 2007-06-23 15:34:22
|
Update of /cvsroot/smartwin/SmartWin/tests/HelloSmartWin In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11651 Modified Files: hello.cpp Log Message: Remove WidgetIcon attempt Index: hello.cpp =================================================================== RCS file: /cvsroot/smartwin/SmartWin/tests/HelloSmartWin/hello.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- hello.cpp 16 Jun 2007 20:04:30 -0000 1.27 +++ hello.cpp 23 Jun 2007 15:34:18 -0000 1.28 @@ -24,75 +24,6 @@ }; // Which of 2 tabbed pages -#define tryIconButton 1 - -#ifdef tryIconButton - -// How to generate you own widgets derived from the existing Widgets -// -// Bitmap dogmap( _T("dog.bmp") ) ) -// -class IconButton - : public WidgetButton< IconButton, SmartWin::MessageMapPolicyNormalWidget > -{ -private: - BitmapPtr itsBgBitmap; - -public: - IconButton( Widget * parent, BitmapPtr bitmap ) - // Note! - // We MUST explicitly call Widget's Constructor since it's a diamond inheritence, at least until bjarne's C++0x gives us Constructor Forwarding... ;) - : Widget( parent ), itsBgBitmap( bitmap ), - WidgetButton< IconButton, SmartWin::MessageMapPolicyNormalWidget >( parent ) - { - } - - void paintBitmapButton( WidgetButton< IconButton, SmartWin::MessageMapPolicyNormalWidget > *btn, Canvas & canvas ) - { - Brush bitmapBrush( canvas, itsBgBitmap ); - sw::Rectangle rc( btn->getClientAreaSize() ); - canvas.fillRectangle( rc, bitmapBrush ); - canvas.setTextColor( RGB( 11, 0, 11 ) ); - canvas.setBkMode( true ); - boost::shared_ptr< Font > font( btn->getFont() ); - canvas.selectFont( font ); - canvas.drawText( btn->getText(), rc, DT_CENTER | DT_VCENTER ); - } - -/* - - // Creating bgImageButton - WidgetButton::Seed buttonCS; - - buttonCS.style |= BS_OWNERDRAW; - buttonCS.caption = _T( "Piip II!" ); - buttonCS.font = createFont( _T( "Comic Sans" ), 28, 8, 4, ANSI_CHARSET, false, false, false, 0, OUT_DEFAULT_PRECIS ); - itsImgButton = createButton( buttonCS ); - itsImgButton->onPainting( & Buttons::paintBitmapButton ); - -*/ - - - // Event handler for "click" event, maark the "funny" paramater... - void click( WidgetButton< IconButton, SmartWin::MessageMapPolicyNormalWidget > * btn ) - { - WidgetMessageBox< SmartWin::Widget > dlg( btn->getParent() ); - dlg.show( btn->getText() ); - } - - void init() - { - // Doing "init" stuff - create(); - onPainting( & IconButton::paintBitmapButton ); - } -}; - -#endif - - - - // HelloWinClass defines a window with native controls based on the Win32 API. // @@ -151,10 +82,6 @@ WidgetTextBoxPtr itsTextA, itsTextB; WidgetTreeViewPtr itsTree; -#ifdef tryIconButton - IconButton * itsIconButton; -#endif - // The Widgets are organized on two child windows // which correspond to the two tabs of the WidgetTabSheet // @@ -379,11 +306,6 @@ itsButton->setText( _T( "Display a message" ) ); itsButton->onClicked( & HelloWinClass::buttonClicked ); -#ifdef tryIconButton - itsIconButton; -#endif - - itsCheckBox = itsSingle->createCheckBox(); itsCheckBox->setText( _T( "&Check me" ) ); itsCheckBox->onClicked( & HelloWinClass::checkclicked ); |