Update of /cvsroot/wxdevcenter/StdPlugin/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23685/src
Modified Files:
BitmapProp.cpp
Log Message:
Add Portrait/Landscape format for bitmap properties.
Index: BitmapProp.cpp
===================================================================
RCS file: /cvsroot/wxdevcenter/StdPlugin/src/BitmapProp.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** BitmapProp.cpp 25 Aug 2005 09:17:43 -0000 1.3
--- BitmapProp.cpp 25 Aug 2005 14:18:28 -0000 1.4
***************
*** 3,7 ****
* @author Cursor
*
! * @brief Impl�mentation des classes des propri�t�s des bitmaps.
*/
--- 3,7 ----
* @author Cursor
*
! * @brief Implémentation des classes des propriétés des bitmaps.
*/
***************
*** 9,17 ****
#include <wxDevCenter/StdPlugin/BitmapProp.h>
using namespace wxDevCenter;
using namespace StdPlugin::Bitmap;
//////////////////////////////////////////////////////////////////////
! // Unités de mesures.
//////////////////////////////////////////////////////////////////////
--- 9,20 ----
#include <wxDevCenter/StdPlugin/BitmapProp.h>
+ #include <wx/bmpbuttn.h>
+ #include <wx/artprov.h>
+
using namespace wxDevCenter;
using namespace StdPlugin::Bitmap;
//////////////////////////////////////////////////////////////////////
! // Unités de mesures.
//////////////////////////////////////////////////////////////////////
***************
*** 99,102 ****
--- 102,128 ----
}
+ // Fixe l'image en mode paysage.
+ void BitmapProperties::SetLandscape()
+ {
+ if(IsPortrait())
+ {
+ wxCoord temp;
+ temp = m_Size.x;
+ m_Size.x = m_Size.y;
+ m_Size.y = temp;
+ }
+ }
+
+ // Fixe l'image en mode portrait.
+ void BitmapProperties::SetPortrait()
+ {
+ if(IsLandscape())
+ {
+ wxCoord temp;
+ temp = m_Size.x;
+ m_Size.x = m_Size.y;
+ m_Size.y = temp;
+ }
+ }
***************
*** 107,114 ****
#define ID_WIDTH_TEXT_CTRL 20
#define ID_HEIGHT_TEXT_CTRL 21
! #define ID_UNIT_CHOICE 22
! #define ID_SIZETEXT_CTRL 23
! #define ID_RES_TEXT_CTRL 24
! #define ID_RESUNIT_CHOICE 25
BEGIN_EVENT_TABLE(BitmapPropertiesDialog, wxDialog)
--- 133,142 ----
#define ID_WIDTH_TEXT_CTRL 20
#define ID_HEIGHT_TEXT_CTRL 21
! #define ID_LANDSCAPE 22
! #define ID_PORTRAIT 23
! #define ID_UNIT_CHOICE 24
! #define ID_SIZETEXT_CTRL 25
! #define ID_RES_TEXT_CTRL 26
! #define ID_RESUNIT_CHOICE 27
BEGIN_EVENT_TABLE(BitmapPropertiesDialog, wxDialog)
***************
*** 119,122 ****
--- 147,153 ----
EVT_TEXT(ID_RES_TEXT_CTRL, BitmapPropertiesDialog::OnResChanged)
+ EVT_BUTTON(ID_LANDSCAPE, BitmapPropertiesDialog::OnFormatLandscape)
+ EVT_BUTTON(ID_PORTRAIT, BitmapPropertiesDialog::OnFormatPortrait)
+
EVT_CHOICE(ID_UNIT_CHOICE, BitmapPropertiesDialog::OnChangeUnit)
EVT_CHOICE(ID_RESUNIT_CHOICE, BitmapPropertiesDialog::OnChangeUnit)
***************
*** 136,142 ****
m_pResUnitChoice = new wxChoice(this, ID_RESUNIT_CHOICE, wxDefaultPosition, wxDefaultSize, 0, NULL);
// Mise en page
! wxSizer* pLineSizer;
wxSizer* pGlobalSizer = new wxBoxSizer(wxVERTICAL);
// Zone de taille
--- 167,177 ----
m_pResUnitChoice = new wxChoice(this, ID_RESUNIT_CHOICE, wxDefaultPosition, wxDefaultSize, 0, NULL);
+ wxBitmapButton *pBmp1 = new wxBitmapButton(this, ID_LANDSCAPE, wxArtProvider::GetIcon(wxT("StdPlugin.Bitmap/landscape"), wxART_BUTTON, wxSize(16, 16))),
+ *pBmp2 = new wxBitmapButton(this, ID_PORTRAIT, wxArtProvider::GetIcon(wxT("StdPlugin.Bitmap/portrait"), wxART_BUTTON, wxSize(16, 16)));
+
// Mise en page
! wxSizer* pLineSizer, *pSizer;;
wxSizer* pGlobalSizer = new wxBoxSizer(wxVERTICAL);
+
// Zone de taille
***************
*** 145,149 ****
pLineSizer->Add(new wxStaticText(this, -1, wxT("Largeur : ")), 0, wxEXPAND|wxALL, 4);
pLineSizer->Add(m_pWidthTextCtrl, 0, wxEXPAND|wxALL, 4);
! pLineSizer->AddStretchSpacer(1);
pLineSizer->Add(new wxStaticText(this, -1, wxT("Longueur : ")), 0, wxEXPAND|wxALL, 4);
pLineSizer->Add(m_pHeightTextCtrl, 0, wxEXPAND|wxALL, 4);
--- 180,187 ----
pLineSizer->Add(new wxStaticText(this, -1, wxT("Largeur : ")), 0, wxEXPAND|wxALL, 4);
pLineSizer->Add(m_pWidthTextCtrl, 0, wxEXPAND|wxALL, 4);
! pSizer = new wxBoxSizer(wxHORIZONTAL);
! pSizer->Add(pBmp1, 0, wxCENTER|wxALL, 4);
! pSizer->Add(pBmp2, 0, wxCENTER|wxALL, 4);
! pLineSizer->Add(pSizer, 0, wxCENTER|wxALL, 4);
pLineSizer->Add(new wxStaticText(this, -1, wxT("Longueur : ")), 0, wxEXPAND|wxALL, 4);
pLineSizer->Add(m_pHeightTextCtrl, 0, wxEXPAND|wxALL, 4);
***************
*** 291,292 ****
--- 329,344 ----
}
+ // Interception de la demande de format paysage.
+ void BitmapPropertiesDialog::OnFormatLandscape(wxCommandEvent& WXUNUSED(event))
+ {
+ m_BmpProp.SetLandscape();
+ UpdateCtrl();
+ }
+
+ // Interception de la demande de format portrait.
+ void BitmapPropertiesDialog::OnFormatPortrait(wxCommandEvent& WXUNUSED(event))
+ {
+ m_BmpProp.SetPortrait();
+ UpdateCtrl();
+ }
+
|