Minor changes to viusal appearance,

Added wxYield() to wxEndBusyCursor(),
  Made wxSpinButton always sent a wxSROLL_THUMBTRACK event,
  Made wxDirDialog resizable,
  Made gsocket.c compile,


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 1999-08-04 14:41:41 +00:00
parent 33961d59b0
commit e65cc56a3b
14 changed files with 45 additions and 21 deletions

View File

@ -442,7 +442,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
(void)new wxStaticText( panel, -1,
"Drag the slider!",
wxPoint(228,30),
wxSize(230, -1)
wxSize(240, -1)
);
#else
(void)new wxStaticText( panel, -1,
@ -453,7 +453,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
"This is also supposed to demonstrate how\n"
"to use static controls.\n",
wxPoint(228,25),
wxSize(230, 110)
wxSize(240, 110)
);
#endif
m_spintext = new wxTextCtrl( panel, -1, "0", wxPoint(20,160), wxSize(80,-1) );

View File

@ -240,8 +240,10 @@ void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) )
void MyFrame::NumericEntry(wxCommandEvent& WXUNUSED(event) )
{
long res = wxGetNumberFromUser("", "Enter a number:", "Numeric input test",
50, 0, 100, this);
long res = wxGetNumberFromUser( "This is some text, actually a lot of text.\n"
"Even two rows of text.",
"Enter a number:", "Numeric input test",
50, 0, 100, this );
wxString msg;
int icon;

View File

@ -330,7 +330,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
const wxString& defaultPath, long style,
const wxPoint& pos) :
wxDialog(parent, -1, message, pos, wxSize(300,300),
wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
m_message = message;
m_dialogStyle = style;

View File

@ -297,7 +297,8 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
}
#if wxUSE_STATLINE
(void) new wxStaticLine( this, -1, wxPoint(0,y-20), wxSize(w+30, 5) );
int edge_margin = 7;
(void) new wxStaticLine( this, -1, wxPoint(edge_margin,y-20), wxSize(w+30-2*edge_margin, 5) );
#endif
SetSize( w+30, y+40 );

View File

@ -158,6 +158,8 @@ void wxEndBusyCursor()
wxSetCursor( gs_savedCursor );
gs_savedCursor = wxNullCursor;
wxYield();
}
void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )

View File

@ -165,7 +165,8 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString
}
#ifdef __WXGTK__
(void) new wxStaticLine( this, -1, wxPoint(0,y-20), wxSize(w+30, 5) );
int edge_margin = 7;
(void) new wxStaticLine( this, -1, wxPoint(edge_margin,y-20), wxSize(w+30-2*edge_margin, 5) );
#endif
SetSize( w+30, y+40 );

View File

@ -55,12 +55,9 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
wxEventType command = wxEVT_NULL;
float line_step = win->m_adjust->step_increment;
float page_step = win->m_adjust->page_increment;
if (fabs(diff-line_step) < sensitivity) command = wxEVT_SCROLL_LINEDOWN;
else if (fabs(diff+line_step) < sensitivity) command = wxEVT_SCROLL_LINEUP;
else if (fabs(diff-page_step) < sensitivity) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < sensitivity) command = wxEVT_SCROLL_PAGEUP;
else command = wxEVT_SCROLL_THUMBTRACK;
int value = (int)ceil(win->m_adjust->value);
@ -68,8 +65,17 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
wxSpinEvent event( command, win->GetId());
event.SetPosition( value );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
/* always send a thumbtrack event */
if (command != wxEVT_SCROLL_THUMBTRACK)
{
command = wxEVT_SCROLL_THUMBTRACK;
wxSpinEvent event2( command, win->GetId());
event2.SetPosition( value );
event2.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event2 );
}
}
//-----------------------------------------------------------------------------

View File

@ -140,7 +140,8 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message,
}
#if wxUSE_STATLINE
(void) new wxStaticLine( this, -1, wxPoint(0,y-20), wxSize(w+30, 5) );
int edge_margin = 7;
(void) new wxStaticLine( this, -1, wxPoint(edge_margin,y-20), wxSize(w+30-2*edge_margin, 5) );
#endif
SetSize( w+30, y+40 );

View File

@ -297,7 +297,8 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
}
#if wxUSE_STATLINE
(void) new wxStaticLine( this, -1, wxPoint(0,y-20), wxSize(w+30, 5) );
int edge_margin = 7;
(void) new wxStaticLine( this, -1, wxPoint(edge_margin,y-20), wxSize(w+30-2*edge_margin, 5) );
#endif
SetSize( w+30, y+40 );

View File

@ -158,6 +158,8 @@ void wxEndBusyCursor()
wxSetCursor( gs_savedCursor );
gs_savedCursor = wxNullCursor;
wxYield();
}
void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )

View File

@ -165,7 +165,8 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString
}
#ifdef __WXGTK__
(void) new wxStaticLine( this, -1, wxPoint(0,y-20), wxSize(w+30, 5) );
int edge_margin = 7;
(void) new wxStaticLine( this, -1, wxPoint(edge_margin,y-20), wxSize(w+30-2*edge_margin, 5) );
#endif
SetSize( w+30, y+40 );

View File

@ -55,12 +55,9 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
wxEventType command = wxEVT_NULL;
float line_step = win->m_adjust->step_increment;
float page_step = win->m_adjust->page_increment;
if (fabs(diff-line_step) < sensitivity) command = wxEVT_SCROLL_LINEDOWN;
else if (fabs(diff+line_step) < sensitivity) command = wxEVT_SCROLL_LINEUP;
else if (fabs(diff-page_step) < sensitivity) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < sensitivity) command = wxEVT_SCROLL_PAGEUP;
else command = wxEVT_SCROLL_THUMBTRACK;
int value = (int)ceil(win->m_adjust->value);
@ -68,8 +65,17 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
wxSpinEvent event( command, win->GetId());
event.SetPosition( value );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
/* always send a thumbtrack event */
if (command != wxEVT_SCROLL_THUMBTRACK)
{
command = wxEVT_SCROLL_THUMBTRACK;
wxSpinEvent event2( command, win->GetId());
event2.SetPosition( value );
event2.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event2 );
}
}
//-----------------------------------------------------------------------------

View File

@ -140,7 +140,8 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message,
}
#if wxUSE_STATLINE
(void) new wxStaticLine( this, -1, wxPoint(0,y-20), wxSize(w+30, 5) );
int edge_margin = 7;
(void) new wxStaticLine( this, -1, wxPoint(edge_margin,y-20), wxSize(w+30-2*edge_margin, 5) );
#endif
SetSize( w+30, y+40 );

View File

@ -487,7 +487,7 @@ bool GSocket_DataAvailable(GSocket *socket)
GSocket_SetNonBlocking() puts the socket in non-blocking mode. This is useful
if we don't want to wait.
*/
void GSocket_SetNonBlocking(GSocket *socket, bool non_block)
void GSocket_SetNonBlocking(GSocket *socket, bool block)
{
assert(socket != NULL);
@ -501,7 +501,7 @@ void GSocket_SetNonBlocking(GSocket *socket, bool non_block)
* GSocket_SetTimeout()
*/
#ifndef LINUX
#if !defined(__LINUX__) && !defined(__FREEBSD__)
# define CAN_USE_TIMEOUT
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
# if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 1)