From 4ee1741f75d443ac816cd90d5d0941d33fdd0698 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 23 Jan 2000 17:09:48 +0000 Subject: [PATCH] Fixed small bug in tab code WRT to having only a single control in a panel. sliders now have keyboard handling. Missing headers for install (memconf.h and geometry.h). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 13 ++++++++++++- distrib/msw/tmake/filelist.txt | 2 ++ src/generic/panelg.cpp | 12 ++++++------ src/gtk/slider.cpp | 4 +++- src/gtk1/slider.cpp | 4 +++- 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4a6ad0420b..e441f8afa5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ # -# This file was automatically generated by tmake at 20:20, 2000/01/22 +# This file was automatically generated by tmake at 17:45, 2000/01/23 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T! # @@ -159,6 +159,7 @@ BASE_HEADERS = \ list.h \ log.h \ longlong.h \ + memconf.h \ memory.h \ mimetype.h \ module.h \ @@ -253,6 +254,7 @@ WX_HEADERS = \ gauge.h \ gdicmn.h \ gdiobj.h \ + geometry.h \ gifdecod.h \ grid.h \ gsocket.h \ @@ -286,6 +288,7 @@ WX_HEADERS = \ longlong.h \ matrix.h \ mdi.h \ + memconf.h \ memory.h \ menu.h \ menuitem.h \ @@ -1807,6 +1810,7 @@ MSW_GUIOBJS = \ menu.o \ menuitem.o \ metafile.o \ + mimetype.o \ minifram.o \ msgdlg.o \ nativdlg.o \ @@ -1899,6 +1903,7 @@ MSW_GUIDEPS = \ menu.d \ menuitem.d \ metafile.d \ + mimetype.d \ minifram.d \ msgdlg.d \ nativdlg.d \ @@ -2237,6 +2242,8 @@ PM_GUIOBJS = \ filedlg.o \ font.o \ fontdlg.o \ + fontenum.o \ + fontutil.o \ frame.o \ gauge.o \ gdiimage.o \ @@ -2252,6 +2259,7 @@ PM_GUIOBJS = \ menu.o \ menuitem.o \ metafile.o \ + mimetype.o \ minifram.o \ msgdlg.o \ nativdlg.o \ @@ -2313,6 +2321,8 @@ PM_GUIDEPS = \ filedlg.d \ font.d \ fontdlg.d \ + fontenum.d \ + fontutil.d \ frame.d \ gauge.d \ gdiimage.d \ @@ -2328,6 +2338,7 @@ PM_GUIDEPS = \ menu.d \ menuitem.d \ metafile.d \ + mimetype.d \ minifram.d \ msgdlg.d \ nativdlg.d \ diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index 8bdeaace9c..09b96c49b1 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -596,6 +596,7 @@ fs_zip.h W gauge.h W gdicmn.h W gdiobj.h W +geometry.h W gifdecod.h W grid.h W gsocket.h W @@ -629,6 +630,7 @@ longlong.h W B matrix.h W mdi.h W memory.h W B +memconf.h W B menu.h W menuitem.h W metafile.h W diff --git a/src/generic/panelg.cpp b/src/generic/panelg.cpp index 24fcb03ba4..4c58bd15a1 100644 --- a/src/generic/panelg.cpp +++ b/src/generic/panelg.cpp @@ -121,9 +121,11 @@ void wxPanel::OnSize(wxSizeEvent& WXUNUSED(event)) void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event ) { - // there is not much to do if we have only one child (or not at all) and + // the event is propagated downwards if the event emitter was our parent + bool goingDown = event.GetEventObject() == GetParent(); + // we're not interested in "notebook page change" events here - if ( (GetChildren().GetCount() < 2) || event.IsWindowChange() ) + if ( event.IsWindowChange() ) { wxWindow *parent = GetParent(); if ( !parent || !parent->GetEventHandler()->ProcessEvent(event) ) @@ -141,9 +143,6 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event ) // next acceptable child wxWindowList::Node *node, *start_node; - // the event is propagated downwards if the event emitter was our parent - bool goingDown = event.GetEventObject() == GetParent(); - const wxWindowList& children = GetChildren(); // we should start from the first/last control and not from the one which @@ -313,7 +312,8 @@ void wxPanel::SetFocus() // think my addition to OnNavigationKey() above takes care of it. // Keeping #ifdef __WXGTK__ for now, but please try removing it and see // what happens. - // RR: Removed for now. + // + // RR: Removed for now. Let's see what happens.. if ( !SetFocusToChild() ) { diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp index 778407f9ed..fba7a8b971 100644 --- a/src/gtk/slider.cpp +++ b/src/gtk/slider.cpp @@ -107,7 +107,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, if (style & wxSL_LABELS) { gtk_scale_set_draw_value( GTK_SCALE( m_widget ), TRUE ); - gtk_scale_set_digits( GTK_SCALE( m_widget ), 0 ); + gtk_scale_set_digits( GTK_SCALE( m_widget ), 0 ); /* labels need more space and too small window will cause junk to appear on the dialog */ @@ -183,6 +183,8 @@ void wxSlider::SetRange( int minValue, int maxValue ) m_adjust->lower = fmin; m_adjust->upper = fmax; + m_adjust->step_increment = 1.0; + m_adjust->page_increment = ceil((fmax-fmin) / 10.0); gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" ); } diff --git a/src/gtk1/slider.cpp b/src/gtk1/slider.cpp index 778407f9ed..fba7a8b971 100644 --- a/src/gtk1/slider.cpp +++ b/src/gtk1/slider.cpp @@ -107,7 +107,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, if (style & wxSL_LABELS) { gtk_scale_set_draw_value( GTK_SCALE( m_widget ), TRUE ); - gtk_scale_set_digits( GTK_SCALE( m_widget ), 0 ); + gtk_scale_set_digits( GTK_SCALE( m_widget ), 0 ); /* labels need more space and too small window will cause junk to appear on the dialog */ @@ -183,6 +183,8 @@ void wxSlider::SetRange( int minValue, int maxValue ) m_adjust->lower = fmin; m_adjust->upper = fmax; + m_adjust->step_increment = 1.0; + m_adjust->page_increment = ceil((fmax-fmin) / 10.0); gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" ); }