mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-26 01:28:38 +08:00
Added Prepend() and Remove() methods to wxSizer,
Corrected a stupid bug in it, Freshed up wxPropertyXXX to make use of the icons in the dialogs. Made wxBmpButton inherit from wxButton. Grumble. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -54,6 +54,12 @@ won't ever work, but there is now a new makefile system
|
||||
that works without libtool and automake, using only
|
||||
configure to create what is needed.
|
||||
|
||||
In order to create configure, you need to have the
|
||||
GNU autoconf package (version 2.13 or 2.14) installed
|
||||
on your system and type run "autoconf" in the base
|
||||
directory (or run the autogen.sh script in the same
|
||||
directory, which just calls autoconf).
|
||||
|
||||
Set WXWIN environment variable to the base directory such
|
||||
as ~/wxWindows (this is actually not really needed).
|
||||
|
||||
|
||||
@@ -2717,6 +2717,7 @@ AC_OUTPUT([
|
||||
samples/minimal/Makefile
|
||||
samples/notebook/Makefile
|
||||
samples/printing/Makefile
|
||||
samples/proplist/Makefile
|
||||
samples/sashtest/Makefile
|
||||
samples/scroll/Makefile
|
||||
samples/splitter/Makefile
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/button.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
@@ -40,7 +41,7 @@ extern const wxChar *wxButtonNameStr;
|
||||
// wxBitmapButton
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxBitmapButton: public wxControl
|
||||
class wxBitmapButton: public wxButton
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||
|
||||
@@ -59,7 +60,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
void SetDefault();
|
||||
virtual void SetDefault();
|
||||
|
||||
void SetLabel( const wxString &label );
|
||||
wxString GetLabel() const;
|
||||
|
||||
@@ -57,7 +57,7 @@ class wxButton: public wxControl
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
void SetDefault();
|
||||
virtual void SetDefault();
|
||||
void SetLabel( const wxString &label );
|
||||
bool Enable( bool enable );
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/button.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
@@ -40,7 +41,7 @@ extern const wxChar *wxButtonNameStr;
|
||||
// wxBitmapButton
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxBitmapButton: public wxControl
|
||||
class wxBitmapButton: public wxButton
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||
|
||||
@@ -59,7 +60,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
void SetDefault();
|
||||
virtual void SetDefault();
|
||||
|
||||
void SetLabel( const wxString &label );
|
||||
wxString GetLabel() const;
|
||||
|
||||
@@ -57,7 +57,7 @@ class wxButton: public wxControl
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
void SetDefault();
|
||||
virtual void SetDefault();
|
||||
void SetLabel( const wxString &label );
|
||||
bool Enable( bool enable );
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/layout.h"
|
||||
#include "wx/sizer.h"
|
||||
|
||||
class wxWindow;
|
||||
class wxProperty;
|
||||
|
||||
@@ -172,12 +172,10 @@ public:
|
||||
wxButton* m_confirmButton; // A tick, as in VB
|
||||
wxButton* m_cancelButton; // A cross, as in VB
|
||||
wxButton* m_editButton; // Invokes the custom validator, if any
|
||||
wxSizer* m_middleSizer;
|
||||
|
||||
bool m_detailedEditing; // E.g. using listbox for choices
|
||||
|
||||
static wxBitmap* sm_tickBitmap;
|
||||
static wxBitmap* sm_crossBitmap;
|
||||
|
||||
wxPanel* m_propertyWindow; // Panel that the controls will appear on
|
||||
wxWindow* m_managedWindow; // Frame or dialog
|
||||
|
||||
|
||||
@@ -92,6 +92,14 @@ public:
|
||||
virtual void Add( wxSizer *sizer, int option = 0, int flag = 0, int border = 0 );
|
||||
virtual void Add( int width, int height, int option = 0, int flag = 0, int border = 0 );
|
||||
|
||||
virtual void Prepend( wxWindow *window, int option = 0, int flag = 0, int border = 0 );
|
||||
virtual void Prepend( wxSizer *sizer, int option = 0, int flag = 0, int border = 0 );
|
||||
virtual void Prepend( int width, int height, int option = 0, int flag = 0, int border = 0 );
|
||||
|
||||
virtual bool Remove( wxWindow *window );
|
||||
virtual bool Remove( wxSizer *sizer );
|
||||
virtual bool Remove( int pos );
|
||||
|
||||
void SetDimension( int x, int y, int width, int height );
|
||||
|
||||
wxSize GetSize()
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
Makefile.in
|
||||
|
||||
|
||||
+65
-4
@@ -197,6 +197,69 @@ void wxSizer::Add( int width, int height, int option, int flag, int border )
|
||||
m_children.Append( new wxSizerItem( width, height, option, flag, border ) );
|
||||
}
|
||||
|
||||
void wxSizer::Prepend( wxWindow *window, int option, int flag, int border )
|
||||
{
|
||||
m_children.Insert( new wxSizerItem( window, option, flag, border ) );
|
||||
}
|
||||
|
||||
void wxSizer::Prepend( wxSizer *sizer, int option, int flag, int border )
|
||||
{
|
||||
m_children.Insert( new wxSizerItem( sizer, option, flag, border ) );
|
||||
}
|
||||
|
||||
void wxSizer::Prepend( int width, int height, int option, int flag, int border )
|
||||
{
|
||||
m_children.Insert( new wxSizerItem( width, height, option, flag, border ) );
|
||||
}
|
||||
|
||||
bool wxSizer::Remove( wxWindow *window )
|
||||
{
|
||||
wxASSERT( window );
|
||||
|
||||
wxNode *node = m_children.First();
|
||||
while (node)
|
||||
{
|
||||
wxSizerItem *item = (wxSizerItem*)node->Data();
|
||||
if (item->GetWindow() == window)
|
||||
{
|
||||
m_children.DeleteNode( node );
|
||||
return TRUE;
|
||||
}
|
||||
node = node->Next();
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxSizer::Remove( wxSizer *sizer )
|
||||
{
|
||||
wxASSERT( sizer );
|
||||
|
||||
wxNode *node = m_children.First();
|
||||
while (node)
|
||||
{
|
||||
wxSizerItem *item = (wxSizerItem*)node->Data();
|
||||
if (item->GetSizer() == sizer)
|
||||
{
|
||||
m_children.DeleteNode( node );
|
||||
return TRUE;
|
||||
}
|
||||
node = node->Next();
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxSizer::Remove( int pos )
|
||||
{
|
||||
wxNode *node = m_children.Nth( pos );
|
||||
if (!node) return FALSE;
|
||||
|
||||
m_children.DeleteNode( node );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxSizer::Fit( wxWindow *window )
|
||||
{
|
||||
window->SetSize( GetMinWindowSize( window ) );
|
||||
@@ -204,7 +267,7 @@ void wxSizer::Fit( wxWindow *window )
|
||||
|
||||
void wxSizer::Layout()
|
||||
{
|
||||
m_size = CalcMin();
|
||||
CalcMin();
|
||||
RecalcSizes();
|
||||
}
|
||||
|
||||
@@ -229,6 +292,7 @@ void wxSizer::SetDimension( int x, int y, int width, int height )
|
||||
m_position.y = y;
|
||||
m_size.x = width;
|
||||
m_size.y = height;
|
||||
CalcMin();
|
||||
RecalcSizes();
|
||||
}
|
||||
|
||||
@@ -244,10 +308,7 @@ wxBoxSizer::wxBoxSizer( int orient )
|
||||
void wxBoxSizer::RecalcSizes()
|
||||
{
|
||||
if (m_children.GetCount() == 0)
|
||||
{
|
||||
SetDimension( m_position.x, m_position.y, 2, 2 );
|
||||
return;
|
||||
}
|
||||
|
||||
int delta = 0;
|
||||
int extra = 0;
|
||||
|
||||
+170
-254
File diff suppressed because it is too large
Load Diff
@@ -587,8 +587,6 @@ bool wxApp::Initialize()
|
||||
wxInitializeResourceSystem();
|
||||
#endif
|
||||
|
||||
wxImage::InitStandardHandlers();
|
||||
|
||||
wxModule::RegisterModules();
|
||||
if (!wxModule::InitializeModules()) return FALSE;
|
||||
|
||||
@@ -622,8 +620,6 @@ void wxApp::CleanUp()
|
||||
|
||||
wxDeleteStockLists();
|
||||
|
||||
wxImage::CleanUpHandlers();
|
||||
|
||||
delete wxTheApp;
|
||||
wxTheApp = (wxApp*) NULL;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma
|
||||
// wxBitmapButton
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
|
||||
|
||||
wxBitmapButton::wxBitmapButton()
|
||||
{
|
||||
|
||||
@@ -587,8 +587,6 @@ bool wxApp::Initialize()
|
||||
wxInitializeResourceSystem();
|
||||
#endif
|
||||
|
||||
wxImage::InitStandardHandlers();
|
||||
|
||||
wxModule::RegisterModules();
|
||||
if (!wxModule::InitializeModules()) return FALSE;
|
||||
|
||||
@@ -622,8 +620,6 @@ void wxApp::CleanUp()
|
||||
|
||||
wxDeleteStockLists();
|
||||
|
||||
wxImage::CleanUpHandlers();
|
||||
|
||||
delete wxTheApp;
|
||||
wxTheApp = (wxApp*) NULL;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma
|
||||
// wxBitmapButton
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
|
||||
|
||||
wxBitmapButton::wxBitmapButton()
|
||||
{
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ include $(top_builddir)/src/make.env
|
||||
all: $(PROGRAM) install_dirs install_data
|
||||
|
||||
$(PROGRAM): $(OBJECTS) $(top_builddir)/lib/@WX_TARGET_LIBRARY@
|
||||
$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJECTS) $(LDLIBS)
|
||||
$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJECTS) $(EXTRALIBS) $(LDLIBS)
|
||||
|
||||
install_dirs:
|
||||
@list='$(DATADIRS)'; for p in $$list; do \
|
||||
|
||||
Reference in New Issue
Block a user