1. panels pass focus to the next item in parent panel

2. warnings removed from iniconf.cpp and it's removed for Win32 compilation
3. wxWindow::PopupMenu(wxPoint) added, documented
4. Docs for wxTextCtrl explicitly mention that EVT_TEXT is triggered by
   programmatic updates too


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-07-20 23:22:30 +00:00
parent 22baaed33e
commit a1665b22b0
13 changed files with 50 additions and 18 deletions

View File

@@ -173,7 +173,7 @@ gdiobj.cpp M
helpwin.cpp M helpwin.cpp M
icon.cpp M icon.cpp M
imaglist.cpp M 32 imaglist.cpp M 32
iniconf.cpp M iniconf.cpp M 16
joystick.cpp M joystick.cpp M
listbox.cpp M listbox.cpp M
listctrl.cpp M 32 listctrl.cpp M 32

View File

@@ -66,7 +66,9 @@ functions that take a \helpref{wxCommandEvent}{wxcommandevent} argument.
\twocolwidtha{7cm}% \twocolwidtha{7cm}%
\begin{twocollist}\itemsep=0pt \begin{twocollist}\itemsep=0pt
\twocolitem{{\bf EVT\_TEXT(id, func)}}{Respond to a wxEVT\_COMMAND\_TEXT\_UPDATED event, \twocolitem{{\bf EVT\_TEXT(id, func)}}{Respond to a wxEVT\_COMMAND\_TEXT\_UPDATED event,
generated when the text changes.} generated when the text changes. Notice that this event will always be sent
when the text controls contents changes - whether this is due to user input or
comes from the program itself (for example, if SetValue() is called)}
\twocolitem{{\bf EVT\_TEXT\_ENTER(id, func)}}{Respond to a wxEVT\_COMMAND\_TEXT\_ENTER event, \twocolitem{{\bf EVT\_TEXT\_ENTER(id, func)}}{Respond to a wxEVT\_COMMAND\_TEXT\_ENTER event,
generated when enter is pressed in a single-line text control.} generated when enter is pressed in a single-line text control.}
\end{twocollist}% \end{twocollist}%

View File

@@ -1492,18 +1492,21 @@ default value is FALSE.}
\membersection{wxWindow::PopupMenu}\label{wxwindowpopupmenu} \membersection{wxWindow::PopupMenu}\label{wxwindowpopupmenu}
\func{virtual bool}{PopupMenu}{\param{wxMenu* }{menu}, \param{int }{x}, \param{int }{y}} \func{bool}{PopupMenu}{\param{wxMenu* }{menu}, \param{const wxPoint& }{pos}}
\func{bool}{PopupMenu}{\param{wxMenu* }{menu}, \param{int }{x}, \param{int }{y}}
Pops up the given menu at the specified coordinates, relative to this Pops up the given menu at the specified coordinates, relative to this
window, and returns control when the user has dismissed the menu. If a window, and returns control when the user has dismissed the menu. If a
menu item is selected, the callback defined for the menu is called with menu item is selected, the corresponding menu event is generated and will be
wxMenu and wxCommandEvent reference arguments. The callback should access processed as usually.
the commandInt member of the event to check the selected menu identifier.
\wxheading{Parameters} \wxheading{Parameters}
\docparam{menu}{Menu to pop up.} \docparam{menu}{Menu to pop up.}
\docparam{pos}{The position where the menu will appear.}
\docparam{x}{Required x position for the menu to appear.} \docparam{x}{Required x position for the menu to appear.}
\docparam{y}{Required y position for the menu to appear.} \docparam{y}{Required y position for the menu to appear.}

View File

@@ -629,7 +629,7 @@ class WXDLLEXPORT wxListCtrl: public wxControl
{ return m_mainWin ? m_mainWin->GetBackgroundColour() : wxColour(); } { return m_mainWin ? m_mainWin->GetBackgroundColour() : wxColour(); }
wxColour GetForegroundColour() const wxColour GetForegroundColour() const
{ return m_mainWin ? m_mainWin->GetForegroundColour() : wxColour(); } { return m_mainWin ? m_mainWin->GetForegroundColour() : wxColour(); }
bool PopupMenu( wxMenu *menu, int x, int y ) bool DoPopupMenu( wxMenu *menu, int x, int y )
{ return m_mainWin->PopupMenu( menu, x, y ); } { return m_mainWin->PopupMenu( menu, x, y ); }
void SetFocus() void SetFocus()
{ m_mainWin->SetFocus(); } { m_mainWin->SetFocus(); }

View File

@@ -86,7 +86,7 @@ public:
const wxFont *theFont = (const wxFont *) NULL) const wxFont *theFont = (const wxFont *) NULL)
const; const;
virtual bool PopupMenu( wxMenu *menu, int x, int y ); virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
virtual void SetScrollbar( int orient, int pos, int thumbVisible, virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = TRUE ); int range, bool refresh = TRUE );

View File

@@ -86,7 +86,7 @@ public:
const wxFont *theFont = (const wxFont *) NULL) const wxFont *theFont = (const wxFont *) NULL)
const; const;
virtual bool PopupMenu( wxMenu *menu, int x, int y ); virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
virtual void SetScrollbar( int orient, int pos, int thumbVisible, virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = TRUE ); int range, bool refresh = TRUE );

View File

@@ -110,7 +110,7 @@ public:
const wxFont *theFont = (const wxFont *) NULL) const wxFont *theFont = (const wxFont *) NULL)
const; const;
virtual bool PopupMenu( wxMenu *menu, int x, int y ); virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
virtual void SetScrollbar( int orient, int pos, int thumbVisible, virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = TRUE ); int range, bool refresh = TRUE );

View File

@@ -531,7 +531,10 @@ public:
void UpdateWindowUI(); void UpdateWindowUI();
virtual bool PopupMenu( wxMenu *menu, int x, int y ) = 0; bool PopupMenu( wxMenu *menu, const wxPoint& pos )
{ return DoPopupMenu(menu, pos.x, pos.y); }
bool PopupMenu( wxMenu *menu, int x, int y )
{ return DoPopupMenu(menu, x, y); }
// scrollbars // scrollbars
// ---------- // ----------
@@ -772,6 +775,8 @@ protected:
virtual void DoSetToolTip( wxToolTip *tip ); virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS #endif // wxUSE_TOOLTIPS
virtual bool DoPopupMenu( wxMenu *menu, int x, int y ) = 0;
private: private:
// contains the last id generated by NewControlId // contains the last id generated by NewControlId
static int ms_lastControlId; static int ms_lastControlId;

View File

@@ -109,6 +109,8 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event )
} }
wxWindowList::Node *start_node = GetChildren().Find( winFocus ); wxWindowList::Node *start_node = GetChildren().Find( winFocus );
if ( !start_node )
start_node = GetChildren().Find( m_winLastFocused );
if ( !start_node ) if ( !start_node )
start_node = GetChildren().GetFirst(); start_node = GetChildren().GetFirst();
@@ -119,6 +121,22 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event )
{ {
if ( !node ) if ( !node )
{ {
// check if our (may be grand) parent is another panel: if this is
// the case, they will know what to do with this navigation key and
// so give them the chance to process it instead of looping inside
// this panel (normally, the focus will go to the next/previous
// item after this panel in the parent panel)
for ( wxWindow *p = GetParent(); p; p = p->GetParent() )
{
if ( wxDynamicCast(p, wxPanel) )
{
event.Skip();
return;
}
}
// no, we are not inside another panel so process this ourself
node = event.GetDirection() ? GetChildren().GetFirst() node = event.GetDirection() ? GetChildren().GetFirst()
: GetChildren().GetLast(); : GetChildren().GetLast();

View File

@@ -2869,7 +2869,7 @@ static void pop_pos_callback( GtkMenu * WXUNUSED(menu),
*y = gs_pop_y; *y = gs_pop_y;
} }
bool wxWindow::PopupMenu( wxMenu *menu, int x, int y ) bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y )
{ {
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );

View File

@@ -2869,7 +2869,7 @@ static void pop_pos_callback( GtkMenu * WXUNUSED(menu),
*y = gs_pop_y; *y = gs_pop_y;
} }
bool wxWindow::PopupMenu( wxMenu *menu, int x, int y ) bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y )
{ {
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );

View File

@@ -442,9 +442,13 @@ bool wxIniConfig::DeleteAll()
char szBuf[MAX_PATH]; char szBuf[MAX_PATH];
size_t nRc = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf)); size_t nRc = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf));
if ( nRc == 0 ) if ( nRc == 0 )
{
wxLogLastError("GetWindowsDirectory"); wxLogLastError("GetWindowsDirectory");
}
else if ( nRc > WXSIZEOF(szBuf) ) else if ( nRc > WXSIZEOF(szBuf) )
{
wxFAIL_MSG("buffer is too small for Windows directory."); wxFAIL_MSG("buffer is too small for Windows directory.");
}
wxString strFile = szBuf; wxString strFile = szBuf;
strFile << '\\' << m_strLocalFilename; strFile << '\\' << m_strLocalFilename;

View File

@@ -1422,7 +1422,7 @@ void wxWindow::GetCaretPos(int *x, int *y) const
// popup menu // popup menu
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
bool wxWindow::PopupMenu(wxMenu *menu, int x, int y) bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
{ {
menu->SetInvokingWindow(this); menu->SetInvokingWindow(this);
menu->UpdateUI(); menu->UpdateUI();