Added wxExtDialog and sample.

Tried to make defs.h slightly more readable, also
    found some wrong flags then.
  Updated testconf.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-07-03 16:40:54 +00:00
parent 4438caf41a
commit 329e86bfde
39 changed files with 832 additions and 220 deletions
+1
View File
@@ -57,6 +57,7 @@ wx_include_HEADERS = \
dynlib.h \
event.h \
expr.h \
extdlg.h \
file.h \
fileconf.h \
filedlg.h \
+237 -177
View File
File diff suppressed because it is too large Load Diff
+7
View File
@@ -0,0 +1,7 @@
#ifndef _WX_EXTDLG_H_BASE_
#define _WX_EXTDLG_H_BASE_
#include "wx/generic/extdlgg.h"
#endif
// _WX_EXTDLG_H_BASE_
+1
View File
@@ -11,6 +11,7 @@ wx_generic_include_HEADERS = \
colrdlgg.h \
dcpsg.h \
dirdlgg.h \
extdlgg.h \
fontdlgg.h \
gridg.h \
helpext.h \
+96
View File
@@ -0,0 +1,96 @@
/////////////////////////////////////////////////////////////////////////////
// Name: extdlgg.h
// Purpose: Extended Generic dialogs
// Author: Robert Roebling
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __EXTDLGH_G__
#define __EXTDLGH_G__
#ifdef __GNUG__
#pragma interface "extdlgg.h"
#endif
#include "wx/setup.h"
#include "wx/dialog.h"
#include "wx/button.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxExtDialog;
class WXDLLEXPORT wxStaticLine;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const wxChar *wxDialogNameStr;
//-----------------------------------------------------------------------------
// wxExtDialog
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxExtDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxExtDialog)
public:
wxExtDialog() {}
wxExtDialog( wxWindow *parent, wxWindowID id,
const wxString& title,
long extraStyle = (wxOK|wxCANCEL|wxCENTRE),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxEXT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr );
bool Create( wxWindow *parent, wxWindowID id,
const wxString& title,
long extraStyle = (wxOK|wxCANCEL|wxCENTRE),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxEXT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr );
void SetClientWindow( wxWindow *clientWindow )
{ m_clientWindow = clientWindow; }
wxWindow *GetClientWindow()
{ return m_clientWindow; }
void AddButton( wxButton *button );
void SetDefaultButton( wxWindowID button );
void EnableButton( wxWindowID button, bool enable=TRUE );
bool ButtonIsEnabled( wxWindowID button );
wxSize GetButtonAreaSize();
void OnSize( wxSizeEvent &event );
void OnYes(wxCommandEvent& event);
void OnNo(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
protected:
wxWindow *m_clientWindow;
long m_extraStyle;
wxList m_buttons;
#if wxUSE_STATLINE
wxStaticLine *m_statLine;
#endif
wxSize LayoutButtons();
private:
DECLARE_EVENT_TABLE()
};
#endif
-8
View File
@@ -35,14 +35,6 @@
#define wxGRID_DEFAULT_VERTICAL_LABEL_WIDTH 40
#define wxGRID_DEFAULT_HORIZONAL_LABEL_HEIGHT 20
#ifndef wxLEFT
#define wxLEFT 0x0400
#endif
#ifndef wxRIGHT
#define wxRIGHT 0x0800
#endif
#define WXGENERIC_GRID_VERSION 0.5
class WXDLLEXPORT wxGridEvent;
-1
View File
@@ -38,7 +38,6 @@ public:
void OnCancel(wxCommandEvent& event);
private:
wxList m_buttons;
int m_dialogStyle;
DECLARE_EVENT_TABLE()
+1 -1
View File
@@ -1,5 +1,5 @@
/* XPM */
static char *info[] = {
static char *info_xpm[] = {
/* columns rows colors chars-per-pixel */
"48 48 478 2",
" c Gray0",
+9 -5
View File
@@ -12,12 +12,12 @@
#define __GTKSTATICLINEH__
#ifdef __GNUG__
#pragma interface
#pragma interface
#endif
#if !wxUSE_STATLINE
#error "This file should only be included if wxUSE_STATLINE == 1"
#endif
#include "wx/defs.h"
#if wxUSE_STATLINE
#include "wx/object.h"
#include "wx/list.h"
@@ -47,4 +47,8 @@ public:
long style = wxLI_HORIZONTAL, const wxString &name = wxStaticTextNameStr );
};
#endif // __GTKSTATICLINEH__
#endif
// wxUSE_STATLINE
#endif
// __GTKSTATICLINEH__
+1 -1
View File
@@ -1,5 +1,5 @@
/* XPM */
static char *info[] = {
static char *info_xpm[] = {
/* columns rows colors chars-per-pixel */
"48 48 478 2",
" c Gray0",
+9 -5
View File
@@ -12,12 +12,12 @@
#define __GTKSTATICLINEH__
#ifdef __GNUG__
#pragma interface
#pragma interface
#endif
#if !wxUSE_STATLINE
#error "This file should only be included if wxUSE_STATLINE == 1"
#endif
#include "wx/defs.h"
#if wxUSE_STATLINE
#include "wx/object.h"
#include "wx/list.h"
@@ -47,4 +47,8 @@ public:
long style = wxLI_HORIZONTAL, const wxString &name = wxStaticTextNameStr );
};
#endif // __GTKSTATICLINEH__
#endif
// wxUSE_STATLINE
#endif
// __GTKSTATICLINEH__
+45 -6
View File
@@ -25,12 +25,13 @@
#include "wx/wx.h"
#endif
#include <wx/colordlg.h>
#include <wx/filedlg.h>
#include <wx/dirdlg.h>
#include <wx/fontdlg.h>
#include <wx/choicdlg.h>
#include <wx/tipdlg.h>
#include "wx/colordlg.h"
#include "wx/filedlg.h"
#include "wx/dirdlg.h"
#include "wx/fontdlg.h"
#include "wx/choicdlg.h"
#include "wx/tipdlg.h"
#include "wx/extdlg.h"
#define wxTEST_GENERIC_DIALOGS_IN_MSW 0
@@ -78,6 +79,7 @@ bool MyApp::OnInit(void)
file_menu->Append(DIALOGS_MESSAGE_BOX, "&Message box");
file_menu->Append(DIALOGS_TEXT_ENTRY, "Text &entry");
file_menu->Append(DIALOGS_SINGLE_CHOICE, "&Single choice");
file_menu->Append(DIALOGS_EXT_DIALOG, "&Extended dialog");
file_menu->AppendSeparator();
file_menu->Append(DIALOGS_TIP, "&Tip of the day");
file_menu->AppendSeparator();
@@ -108,6 +110,42 @@ MyFrame::MyFrame(wxWindow *parent, const wxString& title, const wxPoint& pos, co
wxFrame(parent, -1, title, pos, size)
{}
void MyFrame::ExtDialog(wxCommandEvent& WXUNUSED(event) )
{
// The standard flags causes this dialog to display a
// wxStaticLine under wxMotif and wxGTK, but none under
// other platforms. Also, it will not be resizable
// anywhere.
wxExtDialog dialog( this, -1, "Test 1 for wxExtDialog",
wxOK|wxFORWARD|wxBACKWARD );
dialog.SetClientWindow( new wxTextCtrl( &dialog, -1, "Test", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ) );
// query minimal recommended size from the buttons
dialog.SetSize( dialog.GetButtonAreaSize().x, 170 );
dialog.Centre( wxBOTH );
dialog.ShowModal();
// This dialog uses the standard dialog styles but is also
// resizable on all platforms and shows a wxStaticLine on
// all platforms.
wxExtDialog dialog2( this, -1, "Test 2 for wxExtDialog",
wxOK|wxFORWARD|wxBACKWARD|wxCANCEL, wxDefaultPosition, wxSize(400,170),
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxED_BUTTONS_RIGHT | wxED_STATIC_LINE | wxED_CLIENT_MARGIN );
dialog2.SetClientWindow( new wxTextCtrl( &dialog2, -1, "Test", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ) );
// query minimal recommended size from the buttons
wxSize min_size( dialog2.GetButtonAreaSize() );
dialog2.SetSizeHints( min_size.x + 200, min_size.y );
dialog2.Centre( wxBOTH );
dialog2.ShowModal();
}
void MyFrame::ChooseColour(wxCommandEvent& WXUNUSED(event) )
{
wxColourData data;
@@ -326,6 +364,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(DIALOGS_FILE_SAVE, MyFrame::FileSave)
EVT_MENU(DIALOGS_DIR_CHOOSE, MyFrame::DirChoose)
EVT_MENU(DIALOGS_TIP, MyFrame::ShowTip)
EVT_MENU(DIALOGS_EXT_DIALOG, MyFrame::ExtDialog)
#if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
EVT_MENU(DIALOGS_CHOOSE_COLOUR_GENERIC, MyFrame::ChooseColourGeneric)
EVT_MENU(DIALOGS_CHOOSE_FONT_GENERIC, MyFrame::ChooseFontGeneric)
+9 -6
View File
@@ -27,8 +27,8 @@ class MyFrame: public wxFrame
MyFrame(wxWindow *parent, const wxString& title, const wxPoint& pos,
const wxSize& size);
void ChooseColour(wxCommandEvent& event);
void ChooseFont(wxCommandEvent& event);
void ChooseColour(wxCommandEvent& event);
void ChooseFont(wxCommandEvent& event);
void MessageBox(wxCommandEvent& event);
void SingleChoice(wxCommandEvent& event);
void TextEntry(wxCommandEvent& event);
@@ -36,13 +36,15 @@ class MyFrame: public wxFrame
void FileSave(wxCommandEvent& event);
void DirChoose(wxCommandEvent& event);
void ShowTip(wxCommandEvent& event);
void ExtDialog(wxCommandEvent &event);
#if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW
void ChooseColourGeneric(wxCommandEvent& event);
void ChooseFontGeneric(wxCommandEvent& event);
void ChooseColourGeneric(wxCommandEvent& event);
void ChooseFontGeneric(wxCommandEvent& event);
#endif
void OnExit(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
void OnExit(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
class MyCanvas: public wxScrolledWindow
@@ -69,6 +71,7 @@ DECLARE_EVENT_TABLE()
#define DIALOGS_FILE_SAVE 9
#define DIALOGS_DIR_CHOOSE 10
#define DIALOGS_TIP 11
#define DIALOGS_EXT_DIALOG 12
#endif
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+10 -10
View File
@@ -201,15 +201,15 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
file_output.SeekO( 0 );
wxDataOutputStream data_output( file_output );
wxInt32 i32 = 0xFFFFFFFF;
tmp.Printf( "Signed int32: %d\n", i32 );
wxInt16 i16 = 0xFFFF;
tmp.Printf( "Signed int16: %d\n", (int)i16 );
textCtrl.WriteText( tmp );
data_output.Write32( i32 );
data_output.Write16( i16 );
wxUint32 ui32 = 0xFFFFFFFF;
tmp.Printf( "Unsigned int32: %u\n", ui32 );
wxUint16 ui16 = 0xFFFF;
tmp.Printf( "Unsigned int16: %u\n", (unsigned int) ui16 );
textCtrl.WriteText( tmp );
data_output.Write32( ui32 );
data_output.Write16( ui16 );
d = 2.01234567890123456789;
tmp.Printf( "Double: %f\n", d );
@@ -228,12 +228,12 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
file_input.SeekI( 0 );
wxDataInputStream data_input( file_input );
i32 = data_input.Read32();
tmp.Printf( "Signed int32: %d\n", i32 );
i16 = data_input.Read16();
tmp.Printf( "Signed int16: %d\n", (int)i16 );
textCtrl.WriteText( tmp );
ui32 = data_input.Read32();
tmp.Printf( "Unsigned int32: %u\n", ui32 );
ui16 = data_input.Read16();
tmp.Printf( "Unsigned int16: %u\n", (unsigned int) ui16 );
textCtrl.WriteText( tmp );
d = data_input.ReadDouble();
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
+2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = 1.3 no-dependencies
SUFFIXES = .cpp
DEFS = @DEFS@ $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
File diff suppressed because it is too large Load Diff
+1
View File
@@ -108,6 +108,7 @@ libwx_gtk_la_SOURCES = \
colrdlgg.cpp \
dcpsg.cpp \
dirdlgg.cpp \
extdlgg.cpp \
fontdlgg.cpp \
gridg.cpp \
helpext.cpp \
+1
View File
@@ -108,6 +108,7 @@ libwx_gtk_la_SOURCES = \
colrdlgg.cpp \
dcpsg.cpp \
dirdlgg.cpp \
extdlgg.cpp \
fontdlgg.cpp \
gridg.cpp \
helpext.cpp \