From e6daf794895df62114204499c0c1d54f902be189 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 18 Aug 1999 15:23:15 +0000 Subject: [PATCH] EMX compilation, Minor doc changes, wxFileDialog optical things, wxMessageDlg dimension git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/function.tex | 13 +++----- include/wx/generic/dir_up.xpm | 42 +++++++++++++++++++++++++ include/wx/generic/home.xpm | 44 +++++++++++++------------- include/wx/generic/listview.xpm | 44 +++++++++++++------------- include/wx/generic/new_dir.xpm | 42 +++++++++++++++++++++++++ include/wx/generic/repview.xpm | 44 +++++++++++++------------- src/generic/filedlgg.cpp | 56 ++++++++++++++++++++++++++++----- src/generic/msgdlgg.cpp | 4 +-- src/unix/utilsunx.cpp | 26 +++++++-------- 9 files changed, 215 insertions(+), 100 deletions(-) create mode 100644 include/wx/generic/dir_up.xpm create mode 100644 include/wx/generic/new_dir.xpm diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index 788836a1a7..06a122082e 100644 --- a/docs/latex/wx/function.tex +++ b/docs/latex/wx/function.tex @@ -440,18 +440,15 @@ If path is empty, the current directory will be used. If filename is empty, no default filename will be supplied. The wildcard determines what files are displayed in the file selector, and file extension supplies a type extension for the required filename. Flags may be a combination of wxOPEN, -wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, or 0. They are only significant -at present in Windows. +wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, or 0. -Both the X and Windows versions implement a wildcard filter. Typing a +Both the Unix and Windows versions implement a wildcard filter. Typing a filename containing wildcards (*, ?) in the filename text item, and clicking on Ok, will result in only those files matching the pattern being -displayed. In the X version, supplying no default name will result in the -wildcard filter being inserted in the filename text item; the filter is -ignored if a default name is supplied. +displayed. -Under Windows (only), the wildcard may be a specification for multiple -types of file with a description for each, such as: +The wildcard may be a specification for multiple types of file +with a description for each, such as: \begin{verbatim} "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif" diff --git a/include/wx/generic/dir_up.xpm b/include/wx/generic/dir_up.xpm new file mode 100644 index 0000000000..610339e2a2 --- /dev/null +++ b/include/wx/generic/dir_up.xpm @@ -0,0 +1,42 @@ +/* XPM */ +static char *dir_up_xpm[] = { +/* columns rows colors chars-per-pixel */ +"20 20 16 1", +" c Gray0", +". c #800000", +"X c #008000", +"o c #808000", +"O c #000080", +"+ c #800080", +"@ c #008080", +"# c None", +"$ c #808080", +"% c Red", +"& c Green", +"* c Yellow", +"= c Blue", +"- c Magenta", +"; c Cyan", +": c Gray100", +/* pixels */ +"####################", +"####################", +"####################", +"#### ###########", +"### *:*:* ##########", +"## ####", +"## :*:*:*:*:*:*: ###", +"## *:*: :*:*:*:* ###", +"## :*: :*:*:*: ###", +"## *: :*:*:* ###", +"## :*:* *:*:*:*: ###", +"## *:*: :*:*:*:* ###", +"## :*:* :*: ###", +"## *:*:*:*:*:*:* ###", +"## :*:*:*:*:*:*: ###", +"## ###", +"####################", +"####################", +"####################", +"####################", +}; diff --git a/include/wx/generic/home.xpm b/include/wx/generic/home.xpm index 13dd4ba122..2a16ace29e 100644 --- a/include/wx/generic/home.xpm +++ b/include/wx/generic/home.xpm @@ -1,28 +1,26 @@ /* XPM */ static char * home_xpm[] = { -"22 22 3 1", +"20 20 3 1", " c None", ". c #000000000000", "X c #FFFFFFFFFFFF", -" ", -" ", -" ", -" .. ", -" . .... ", -" . .XX . ", -" . .XXXX . ", -" ..XXXXXX . ", -" .XXXXXXXX . ", -" .XXXXXXXXX . ", -" ...XXXXXXXX ... ", -" .XXXXXXXX . ", -" .XXX...XX . ", -" .XXX. .XX . ", -" .XXX. .XX . ", -" .XXX. .XX . ", -" .XXX. .XX . ", -" ..... ...... ", -" ", -" ", -" ", -" "}; +" ", +" ", +" .. ", +" . .... ", +" . .XX . ", +" . .XXXX . ", +" ..XXXXXX . ", +" .XXXXXXXX . ", +" .XXXXXXXXX . ", +" ...XXXXXXXX ... ", +" .XXXXXXXX . ", +" .XXX...XX . ", +" .XXX. .XX . ", +" .XXX. .XX . ", +" .XXX. .XX . ", +" .XXX. .XX . ", +" ..... ...... ", +" ", +" ", +" "}; diff --git a/include/wx/generic/listview.xpm b/include/wx/generic/listview.xpm index 9979a4887b..56b61c1bc6 100644 --- a/include/wx/generic/listview.xpm +++ b/include/wx/generic/listview.xpm @@ -1,30 +1,28 @@ /* XPM */ static char * listview_xpm[] = { -"22 22 3 1", +"20 20 3 1", " c None", ". c #000000000000", "X c #FFFFFFFFFFFF", -" ", -" ", -" ", -" ", -" ", -" ................. ", -" .XXXXXXXXXXXXXXX. ", -" .XX.....XXX....X. ", -" .XXXXXXXXXXXXXXX. ", -" .XX...XXXXX..XXX. ", -" .XXXXXXXXXXXXXXX. ", -" .XX..XXXXXX...XX. ", -" .XXXXXXXXXXXXXXX. ", -" .XX.....XXX...XX. ", -" .XXXXXXXXXXXXXXX. ", -" .XX...XXXXXXXXXX. ", -" .XXXXXXXXXXXXXXX. ", -" ................. ", -" ", -" ", -" ", -" "}; +" ", +" ", +" ", +" ................. ", +" .XXXXXXXXXXXXXXX. ", +" .XX.....XXX....X. ", +" .XXXXXXXXXXXXXXX. ", +" .XX...XXXXX..XXX. ", +" .XXXXXXXXXXXXXXX. ", +" .XX..XXXXXX...XX. ", +" .XXXXXXXXXXXXXXX. ", +" .XX.....XXX...XX. ", +" .XXXXXXXXXXXXXXX. ", +" .XX...XXXXXXXXXX. ", +" .XXXXXXXXXXXXXXX. ", +" ................. ", +" ", +" ", +" ", +" "}; diff --git a/include/wx/generic/new_dir.xpm b/include/wx/generic/new_dir.xpm new file mode 100644 index 0000000000..86a1085e53 --- /dev/null +++ b/include/wx/generic/new_dir.xpm @@ -0,0 +1,42 @@ +/* XPM */ +static char *new_dir_xpm[] = { +/* columns rows colors chars-per-pixel */ +"20 20 16 1", +" c Gray0", +". c #800000", +"X c #008000", +"o c #808000", +"O c #000080", +"+ c #800080", +"@ c #008080", +"# c None", +"$ c #808080", +"% c Red", +"& c Green", +"* c Yellow", +"= c Blue", +"- c Magenta", +"; c Cyan", +": c Gray100", +/* pixels */ +"####################", +"####################", +"############# ######", +"####################", +"############# ######", +"########## ##### ###", +"##### ## # # ####", +"#### *:*: ## # #####", +"### ## # ##", +"### :*:*:*:*: #####", +"### *:*:*:*:* # ####", +"### :*:*:*:*: ## ###", +"### *:*:*:*:* ######", +"### :*:*:*:*: ######", +"### *:*:*:*:* ######", +"### ######", +"####################", +"####################", +"####################", +"####################" +}; diff --git a/include/wx/generic/repview.xpm b/include/wx/generic/repview.xpm index bde05a6327..8f40d3f105 100644 --- a/include/wx/generic/repview.xpm +++ b/include/wx/generic/repview.xpm @@ -1,31 +1,29 @@ /* XPM */ static char * repview_xpm[] = { -"22 22 3 1", +"20 20 3 1", " c None", ". c #000000000000", "X c #FFFFFFFFFFFF", -" ", -" ", -" ", -" ", -" ", -" ................. ", -" .XXXXXXXXXXXXXXX. ", -" ................. ", -" .XXXXXXXXXXXXXXX. ", -" .XX..XXXX.XX..XX. ", -" .XXXXXXXXXXXXXXX. ", -" .XX...XXX.XX..XX. ", -" .XXXXXXXXXXXXXXX. ", -" .XX...XXX.XX..XX. ", -" .XXXXXXXXXXXXXXX. ", -" .XX...XXX.XX..XX. ", -" .XXXXXXXXXXXXXXX. ", -" ................. ", -" ", -" ", -" ", -" "}; +" ", +" ", +" ", +" ................. ", +" .XXXXXXXXXXXXXXX. ", +" ................. ", +" .XXXXXXXXXXXXXXX. ", +" .XX..XXXX.XX..XX. ", +" .XXXXXXXXXXXXXXX. ", +" .XX...XXX.XX..XX. ", +" .XXXXXXXXXXXXXXX. ", +" .XX...XXX.XX..XX. ", +" .XXXXXXXXXXXXXXX. ", +" .XX...XXX.XX..XX. ", +" .XXXXXXXXXXXXXXX. ", +" ................. ", +" ", +" ", +" ", +" "}; diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 3001f96271..c7b18c9f42 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -32,6 +32,10 @@ #include "wx/sizer.h" #include "wx/bmpbuttn.h" +#if wxUSE_TOOLTIPS + #include "wx/tooltip.h" +#endif + #include "sys/types.h" #include "sys/stat.h" #include "dirent.h" @@ -42,6 +46,8 @@ #include "wx/generic/home.xpm" #include "wx/generic/listview.xpm" #include "wx/generic/repview.xpm" +#include "wx/generic/new_dir.xpm" +#include "wx/generic/dir_up.xpm" /* XPM */ static char * folder_xpm[] = { @@ -318,7 +324,7 @@ void wxFileCtrl::Update() long my_style = GetWindowStyleFlag(); if (my_style & wxLC_REPORT) { - InsertColumn( 0, _("Name"), wxLIST_FORMAT_LEFT, 110 ); + InsertColumn( 0, _("Name"), wxLIST_FORMAT_LEFT, 130 ); InsertColumn( 1, _("Size"), wxLIST_FORMAT_LEFT, 60 ); InsertColumn( 2, _("Date"), wxLIST_FORMAT_LEFT, 55 ); InsertColumn( 3, _("Time"), wxLIST_FORMAT_LEFT, 50 ); @@ -429,12 +435,16 @@ void wxFileCtrl::GoToHomeDir() wxString s = wxGetUserHome( wxString() ); m_dirName = s; Update(); + SetItemState( 0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); + EnsureVisible( 0 ); } void wxFileCtrl::GoToDir( const wxString &dir ) { m_dirName = dir; Update(); + SetItemState( 0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); + EnsureVisible( 0 ); } void wxFileCtrl::GetDir( wxString &dir ) @@ -522,7 +532,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& wildCard, long style, const wxPoint& pos ) : - wxDialog( parent, -1, message ) + wxDialog( parent, -1, message, pos, wxDefaultSize, style | wxRESIZE_BORDER ) { wxBeginBusyCursor(); @@ -541,15 +551,45 @@ wxFileDialog::wxFileDialog(wxWindow *parent, wxBoxSizer *buttonsizer = new wxBoxSizer( wxHORIZONTAL ); - buttonsizer->Add( new wxBitmapButton( this, ID_LIST_MODE, wxBitmap( listview_xpm ) ), 0, wxALL, 5 ); - buttonsizer->Add( new wxBitmapButton( this, ID_REPORT_MODE, wxBitmap( repview_xpm ) ), 0, wxALL, 5 ); + wxBitmapButton *but; + + but = new wxBitmapButton( this, ID_LIST_MODE, wxBitmap( listview_xpm ) ); +#if wxUSE_TOOLTIPS + but->SetToolTip( _("View files as a list view") ); +#endif + buttonsizer->Add( but, 0, wxALL, 5 ); + + but = new wxBitmapButton( this, ID_REPORT_MODE, wxBitmap( repview_xpm ) ); +#if wxUSE_TOOLTIPS + but->SetToolTip( _("View files as a detailed view") ); +#endif + buttonsizer->Add( but, 0, wxALL, 5 ); + buttonsizer->Add( 30, 5, 1 ); - buttonsizer->Add( new wxButton( this, ID_UP_DIR, "Up" ), 0, wxALL, 5 ); - buttonsizer->Add( new wxBitmapButton( this, ID_PARENT_DIR, wxBitmap(home_xpm) ), 0, wxALL, 5 ); - buttonsizer->Add( new wxButton( this, ID_NEW_DIR, "New..." ), 0, wxALL, 5 ); + + but = new wxBitmapButton( this, ID_UP_DIR, wxBitmap( dir_up_xpm ) ); +#if wxUSE_TOOLTIPS + but->SetToolTip( _("Go to parent directory") ); +#endif + buttonsizer->Add( but, 0, wxALL, 5 ); + + but = new wxBitmapButton( this, ID_PARENT_DIR, wxBitmap(home_xpm) ); +#if wxUSE_TOOLTIPS + but->SetToolTip( _("Go to home directory") ); +#endif + buttonsizer->Add( but, 0, wxALL, 5); + + buttonsizer->Add( 20, 20 ); + + but = new wxBitmapButton( this, ID_NEW_DIR, wxBitmap(new_dir_xpm) ); +#if wxUSE_TOOLTIPS + but->SetToolTip( _("Create new directory") ); +#endif + buttonsizer->Add( but, 0, wxALL, 5 ); + mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 5 ); - m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, "*", wxDefaultPosition, wxSize(450,180), + m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, "*", wxDefaultPosition, wxSize(440,180), wxLC_LIST | wxSUNKEN_BORDER | wxLC_SINGLE_SEL ); mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 ); diff --git a/src/generic/msgdlgg.cpp b/src/generic/msgdlgg.cpp index 2cc9da5c5d..19aefb7c06 100644 --- a/src/generic/msgdlgg.cpp +++ b/src/generic/msgdlgg.cpp @@ -98,9 +98,9 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, topsizer->SetSizeHints( this ); topsizer->Fit( this ); wxSize size( GetSize() ); - if (size.x < size.y*2) + if (size.x < size.y*3/2) { - size.x = size.y*2; + size.x = size.y*3/2; SetSize( size ); } diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index ea6fd78a5f..e9510f7235 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -64,22 +64,22 @@ #ifdef __SUN__ int usleep(unsigned int usec); #else // !Sun - void usleep(unsigned long usec); - #endif // Sun/!Sun + #ifdef __EMX + /* I copied this from the XFree86 diffs. AV. */ + #define INCL_DOSPROCESS + #include + void usleep(unsigned long delay) + { + DosSleep(delay ? (delay/1000l) : 1l); + } + #else + void usleep(unsigned long usec); + #endif + #endif // Sun/EMX/Something else }; +#define HAVE_USLEEP 1 #endif // Unices without usleep() -#ifdef __EMX__ - /* I copied this from the XFree86 diffs. AV. */ -//extern void DosSleep(unsigned long); -#define INCL_DOSPROCESS -#include -void usleep(unsigned long delay) -{ - DosSleep(delay ? (delay/1000l) : 1l); -} -#endif - // ============================================================================ // implementation // ============================================================================ -- 2.47.2