BC++ updates, propery form fix, dialog fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2000-06-19 14:23:14 +00:00
parent b4e9e877bd
commit 3e47e5afcf
6 changed files with 471 additions and 459 deletions

View File

@@ -181,7 +181,7 @@ $(LIBTARGET): $(DUMMY).obj $(OBJECTS)
$(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(LIBTARGET): $(DUMMY).obj $(OBJECTS)
-erase $(LIBTARGET) -erase $(LIBTARGET)
-erase $(WXLIBDIR)\wx.dll -erase $(WXLIBDIR)\wx.dll
$(LINK) $(LINK_FLAGS) /L$(WXLIBDIR) /v @&&! $(LINK) $(LINK_FLAGS) /L$(WXLIBDIR);$(BCCDIR)\lib;$(BCCDIR)\lib\psdk /v @&&!
c0d32.obj $(OBJECTS) c0d32.obj $(OBJECTS)
$(WXLIBDIR)\wx $(WXLIBDIR)\wx
nul nul

View File

@@ -45,7 +45,8 @@ Default constructor.
Copy constructor. Copy constructor.
\func{}{wxVariant}{\param{const char*}{ value}, \param{const wxString\& }{name = ``"}}\\ \func{}{wxVariant}{\param{const char*}{ value}, \param{const wxString\& }{name = ``"}}
\func{}{wxVariant}{\param{const wxString\&}{ value}, \param{const wxString\& }{name = ``"}} \func{}{wxVariant}{\param{const wxString\&}{ value}, \param{const wxString\& }{name = ``"}}
Construction from a string value. Construction from a string value.

View File

@@ -281,6 +281,8 @@ public:
// Extend event processing to search the view's event table // Extend event processing to search the view's event table
virtual bool ProcessEvent(wxEvent& event); virtual bool ProcessEvent(wxEvent& event);
void SetView(wxPropertyFormView* view) { m_view = view; }
wxPropertyFormView* GetView() const { return m_view; }
private: private:
wxPropertyFormView* m_view; wxPropertyFormView* m_view;

View File

@@ -33,17 +33,17 @@
/* /*
* Property view * Property view
*/ */
IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormView, wxPropertyView) IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormView, wxPropertyView)
BEGIN_EVENT_TABLE(wxPropertyFormView, wxPropertyView) BEGIN_EVENT_TABLE(wxPropertyFormView, wxPropertyView)
EVT_BUTTON(wxID_OK, wxPropertyFormView::OnOk) EVT_BUTTON(wxID_OK, wxPropertyFormView::OnOk)
EVT_BUTTON(wxID_CANCEL, wxPropertyFormView::OnCancel) EVT_BUTTON(wxID_CANCEL, wxPropertyFormView::OnCancel)
EVT_BUTTON(wxID_HELP, wxPropertyFormView::OnHelp) EVT_BUTTON(wxID_HELP, wxPropertyFormView::OnHelp)
EVT_BUTTON(wxID_PROP_REVERT, wxPropertyFormView::OnRevert) EVT_BUTTON(wxID_PROP_REVERT, wxPropertyFormView::OnRevert)
EVT_BUTTON(wxID_PROP_UPDATE, wxPropertyFormView::OnUpdate) EVT_BUTTON(wxID_PROP_UPDATE, wxPropertyFormView::OnUpdate)
END_EVENT_TABLE() END_EVENT_TABLE()
bool wxPropertyFormView::sm_dialogCancelled = FALSE; bool wxPropertyFormView::sm_dialogCancelled = FALSE;
@@ -69,8 +69,8 @@ void wxPropertyFormView::ShowView(wxPropertySheet *ps, wxWindow *panel)
m_propertySheet = ps; m_propertySheet = ps;
AssociatePanel(panel); AssociatePanel(panel);
// CreateControls(); // CreateControls();
// UpdatePropertyList(); // UpdatePropertyList();
} }
// Update this view of the viewed object, called e.g. by // Update this view of the viewed object, called e.g. by
@@ -164,6 +164,10 @@ bool wxPropertyFormView::AssociateNames(void)
bool wxPropertyFormView::OnClose(void) bool wxPropertyFormView::OnClose(void)
{ {
if (m_propertyWindow->IsKindOf(CLASSINFO(wxPropertyFormPanel)))
{
((wxPropertyFormPanel*)m_propertyWindow)->SetView(NULL);
}
delete this; delete this;
return TRUE; return TRUE;
} }
@@ -281,23 +285,23 @@ void wxPropertyFormView::OnDoubleClick(wxControl *item)
} }
/* /*
* Property form dialog box * Property form dialog box
*/ */
IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormDialog, wxDialog) IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormDialog, wxDialog)
BEGIN_EVENT_TABLE(wxPropertyFormDialog, wxDialog) BEGIN_EVENT_TABLE(wxPropertyFormDialog, wxDialog)
EVT_CLOSE(wxPropertyFormDialog::OnCloseWindow) EVT_CLOSE(wxPropertyFormDialog::OnCloseWindow)
END_EVENT_TABLE() END_EVENT_TABLE()
wxPropertyFormDialog::wxPropertyFormDialog(wxPropertyFormView *v, wxWindow *parent, const wxString& title, wxPropertyFormDialog::wxPropertyFormDialog(wxPropertyFormView *v, wxWindow *parent, const wxString& title,
const wxPoint& pos, const wxSize& size, long style, const wxString& name): const wxPoint& pos, const wxSize& size, long style, const wxString& name):
wxDialog(parent, -1, title, pos, size, style, name) wxDialog(parent, -1, title, pos, size, style, name)
{ {
m_view = v; m_view = v;
m_view->AssociatePanel(this); m_view->AssociatePanel(this);
m_view->SetManagedWindow(this); m_view->SetManagedWindow(this);
// SetAutoLayout(TRUE); // SetAutoLayout(TRUE);
} }
void wxPropertyFormDialog::OnCloseWindow(wxCloseEvent& event) void wxPropertyFormDialog::OnCloseWindow(wxCloseEvent& event)
@@ -334,8 +338,8 @@ bool wxPropertyFormDialog::ProcessEvent(wxEvent& event)
/* /*
* Property form panel * Property form panel
*/ */
IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormPanel, wxPanel) IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormPanel, wxPanel)
@@ -359,13 +363,13 @@ bool wxPropertyFormPanel::ProcessEvent(wxEvent& event)
} }
/* /*
* Property frame * Property frame
*/ */
IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormFrame, wxFrame) IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormFrame, wxFrame)
BEGIN_EVENT_TABLE(wxPropertyFormFrame, wxFrame) BEGIN_EVENT_TABLE(wxPropertyFormFrame, wxFrame)
EVT_CLOSE(wxPropertyFormFrame::OnCloseWindow) EVT_CLOSE(wxPropertyFormFrame::OnCloseWindow)
END_EVENT_TABLE() END_EVENT_TABLE()
void wxPropertyFormFrame::OnCloseWindow(wxCloseEvent& event) void wxPropertyFormFrame::OnCloseWindow(wxCloseEvent& event)
@@ -394,16 +398,16 @@ bool wxPropertyFormFrame::Initialize(void)
return FALSE; return FALSE;
} }
/* /*
* Property form specific validator * Property form specific validator
*/ */
IMPLEMENT_ABSTRACT_CLASS(wxPropertyFormValidator, wxPropertyValidator) IMPLEMENT_ABSTRACT_CLASS(wxPropertyFormValidator, wxPropertyValidator)
/* /*
* Default validators * Default validators
*/ */
IMPLEMENT_DYNAMIC_CLASS(wxRealFormValidator, wxPropertyFormValidator) IMPLEMENT_DYNAMIC_CLASS(wxRealFormValidator, wxPropertyFormValidator)
@@ -619,7 +623,7 @@ bool wxBoolFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormVie
IMPLEMENT_DYNAMIC_CLASS(wxStringFormValidator, wxPropertyFormValidator) IMPLEMENT_DYNAMIC_CLASS(wxStringFormValidator, wxPropertyFormValidator)
wxStringFormValidator::wxStringFormValidator(wxStringList *list, long flags): wxStringFormValidator::wxStringFormValidator(wxStringList *list, long flags):
wxPropertyFormValidator(flags) wxPropertyFormValidator(flags)
{ {
m_strings = list; m_strings = list;
} }
@@ -672,7 +676,7 @@ bool wxStringFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyForm
if (lbox->GetSelection() > -1) if (lbox->GetSelection() > -1)
property->GetValue() = lbox->GetStringSelection(); property->GetValue() = lbox->GetStringSelection();
} }
/* /*
else if (m_propertyWindow->IsKindOf(CLASSINFO(wxRadioBox))) else if (m_propertyWindow->IsKindOf(CLASSINFO(wxRadioBox)))
{ {
wxRadioBox *rbox = (wxRadioBox *)m_propertyWindow; wxRadioBox *rbox = (wxRadioBox *)m_propertyWindow;
@@ -680,7 +684,7 @@ bool wxStringFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyForm
if ((n = rbox->GetSelection()) > -1) if ((n = rbox->GetSelection()) > -1)
property->GetValue() = rbox->GetString(n); property->GetValue() = rbox->GetString(n);
} }
*/ */
else if (m_propertyWindow->IsKindOf(CLASSINFO(wxChoice))) else if (m_propertyWindow->IsKindOf(CLASSINFO(wxChoice)))
{ {
wxChoice *choice = (wxChoice *)m_propertyWindow; wxChoice *choice = (wxChoice *)m_propertyWindow;
@@ -720,13 +724,13 @@ bool wxStringFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormV
} }
lbox->SetStringSelection(property->GetValue().StringValue()); lbox->SetStringSelection(property->GetValue().StringValue());
} }
/* /*
else if (m_propertyWindow->IsKindOf(CLASSINFO(wxRadioBox))) else if (m_propertyWindow->IsKindOf(CLASSINFO(wxRadioBox)))
{ {
wxRadioBox *rbox = (wxRadioBox *)m_propertyWindow; wxRadioBox *rbox = (wxRadioBox *)m_propertyWindow;
rbox->SetStringSelection(property->GetValue().StringValue()); rbox->SetStringSelection(property->GetValue().StringValue());
} }
*/ */
else if (m_propertyWindow->IsKindOf(CLASSINFO(wxChoice))) else if (m_propertyWindow->IsKindOf(CLASSINFO(wxChoice)))
{ {
wxChoice *choice = (wxChoice *)m_propertyWindow; wxChoice *choice = (wxChoice *)m_propertyWindow;

View File

@@ -329,14 +329,16 @@ void wxDialog::DoShowModal()
wxWindow *parent = GetParent(); wxWindow *parent = GetParent();
wxWindow* oldFocus = m_oldFocus;
// inside this block, all app windows are disabled // inside this block, all app windows are disabled
{ {
wxWindowDisabler wd(this); wxWindowDisabler wd(this);
// remember where the focus was // remember where the focus was
if ( !m_oldFocus ) if ( !oldFocus )
{ {
m_oldFocus = parent; oldFocus = parent;
} }
// enter the modal loop // enter the modal loop
@@ -360,9 +362,12 @@ void wxDialog::DoShowModal()
#endif // __WIN32__ #endif // __WIN32__
// and restore focus // and restore focus
if ( m_oldFocus && (m_oldFocus != this) ) // Note that this code MUST NOT access the dialog object's data
// in case the object has been deleted (which will be the case
// for a modal dialog that has been destroyed before calling EndModal).
if ( oldFocus && (oldFocus != this) )
{ {
m_oldFocus->SetFocus(); oldFocus->SetFocus();
} }
} }

View File

@@ -361,7 +361,7 @@ $(LIBTARGET): $(DUMMY).obj $(OBJECTS)
$(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(LIBTARGET): $(DUMMY).obj $(OBJECTS)
-erase $(LIBTARGET) -erase $(LIBTARGET)
-erase $(WXLIBDIR)\wx.dll -erase $(WXLIBDIR)\wx.dll
$(LINK) $(LINK_FLAGS) /L$(WXLIBDIR) /v @&&! $(LINK) $(LINK_FLAGS) /L$(WXLIBDIR);$(BCCDIR)\lib;$(BCCDIR)\lib\psdk /v @&&!
c0d32.obj $(OBJECTS) c0d32.obj $(OBJECTS)
$(WXLIBDIR)\wx $(WXLIBDIR)\wx
nul nul