Applied a few old patches,

Changed dclick handling in wxFileDialog,
  Added cursor code to wxToolBar


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 1999-10-04 09:03:48 +00:00
parent a439ecef10
commit 9b7e522ae9
10 changed files with 110 additions and 20 deletions

View File

@ -48,11 +48,7 @@ extern const wxChar *wxToolBarNameStr;
class wxToolBar: public wxControl
{
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxToolBar)
public:
public:
wxToolBar(void);
wxToolBar( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
@ -120,6 +116,12 @@ class wxToolBar: public wxControl
int m_xMargin;
int m_yMargin;
bool m_hasToolAlready;
void OnInternalIdle();
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxToolBar)
};
#endif

View File

@ -48,11 +48,7 @@ extern const wxChar *wxToolBarNameStr;
class wxToolBar: public wxControl
{
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxToolBar)
public:
public:
wxToolBar(void);
wxToolBar( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
@ -120,6 +116,12 @@ class wxToolBar: public wxControl
int m_xMargin;
int m_yMargin;
bool m_hasToolAlready;
void OnInternalIdle();
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxToolBar)
};
#endif

View File

@ -812,12 +812,14 @@ void wxFileDialog::HandleAction( const wxString &fn )
}
SetPath( filename );
wxCommandEvent event;
wxDialog::OnOK(event);
}
void wxFileDialog::OnListOk( wxCommandEvent &event )
{
HandleAction( m_text->GetValue() );
event.Skip();
}
void wxFileDialog::OnList( wxCommandEvent &WXUNUSED(event) )

View File

@ -52,7 +52,7 @@ bool wxCheckListBox::IsChecked( int index ) const
GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child );
wxString str = wxString(label->label,*wxConv_current);
wxString str = wxString(label->label,*wxConvCurrent);
return (str[1] == _T('X'));
}

View File

@ -1011,8 +1011,9 @@ void wxListBox::OnInternalIdle()
wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (m_widget->window && cursor.Ok() && m_currentGdkCursor != cursor)
if (GTK_WIDGET(m_list)->window && cursor.Ok() && m_currentGdkCursor != cursor)
{
wxCursor oldGdkCursor = m_currentGdkCursor;
m_currentGdkCursor = cursor;
gdk_window_set_cursor( GTK_WIDGET(m_list)->window, m_currentGdkCursor.GetCursor() );
@ -1023,7 +1024,16 @@ void wxListBox::OnInternalIdle()
GtkBin *bin = GTK_BIN( child->data );
GtkWidget *label = GTK_WIDGET( bin->child );
gdk_window_set_cursor( label->window, m_currentGdkCursor.GetCursor() );
if (!label->window)
{
/* windows not yet realized. come back later. */
m_currentGdkCursor = oldGdkCursor;
break;
}
else
{
gdk_window_set_cursor( label->window, m_currentGdkCursor.GetCursor() );
}
child = child->next;
}

View File

@ -32,7 +32,8 @@ extern bool g_isIdle;
// data
//-----------------------------------------------------------------------------
extern bool g_blockEventsOnDrag;
extern bool g_blockEventsOnDrag;
extern wxCursor g_globalCursor;
//-----------------------------------------------------------------------------
// "clicked" (internal from gtk_toolbar)
@ -598,4 +599,35 @@ void wxToolBar::OnIdle( wxIdleEvent &WXUNUSED(ievent) )
}
}
void wxToolBar::OnInternalIdle()
{
wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (cursor.Ok() && m_currentGdkCursor != cursor)
{
wxCursor oldGdkCursor = m_currentGdkCursor;
m_currentGdkCursor = cursor;
wxNode *node = m_tools.First();
while (node)
{
wxToolBarTool *tool = (wxToolBarTool*)node->Data();
if (!tool->m_item->window)
{
/* windows not yet realized. come back later. */
m_currentGdkCursor = oldGdkCursor;
break;
}
else
{
gdk_window_set_cursor( tool->m_item->window, m_currentGdkCursor.GetCursor() );
}
node = node->Next();
}
}
UpdateWindowUI();
}
#endif

View File

@ -52,7 +52,7 @@ bool wxCheckListBox::IsChecked( int index ) const
GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child );
wxString str = wxString(label->label,*wxConv_current);
wxString str = wxString(label->label,*wxConvCurrent);
return (str[1] == _T('X'));
}

View File

@ -1011,8 +1011,9 @@ void wxListBox::OnInternalIdle()
wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (m_widget->window && cursor.Ok() && m_currentGdkCursor != cursor)
if (GTK_WIDGET(m_list)->window && cursor.Ok() && m_currentGdkCursor != cursor)
{
wxCursor oldGdkCursor = m_currentGdkCursor;
m_currentGdkCursor = cursor;
gdk_window_set_cursor( GTK_WIDGET(m_list)->window, m_currentGdkCursor.GetCursor() );
@ -1023,7 +1024,16 @@ void wxListBox::OnInternalIdle()
GtkBin *bin = GTK_BIN( child->data );
GtkWidget *label = GTK_WIDGET( bin->child );
gdk_window_set_cursor( label->window, m_currentGdkCursor.GetCursor() );
if (!label->window)
{
/* windows not yet realized. come back later. */
m_currentGdkCursor = oldGdkCursor;
break;
}
else
{
gdk_window_set_cursor( label->window, m_currentGdkCursor.GetCursor() );
}
child = child->next;
}

View File

@ -32,7 +32,8 @@ extern bool g_isIdle;
// data
//-----------------------------------------------------------------------------
extern bool g_blockEventsOnDrag;
extern bool g_blockEventsOnDrag;
extern wxCursor g_globalCursor;
//-----------------------------------------------------------------------------
// "clicked" (internal from gtk_toolbar)
@ -598,4 +599,35 @@ void wxToolBar::OnIdle( wxIdleEvent &WXUNUSED(ievent) )
}
}
void wxToolBar::OnInternalIdle()
{
wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (cursor.Ok() && m_currentGdkCursor != cursor)
{
wxCursor oldGdkCursor = m_currentGdkCursor;
m_currentGdkCursor = cursor;
wxNode *node = m_tools.First();
while (node)
{
wxToolBarTool *tool = (wxToolBarTool*)node->Data();
if (!tool->m_item->window)
{
/* windows not yet realized. come back later. */
m_currentGdkCursor = oldGdkCursor;
break;
}
else
{
gdk_window_set_cursor( tool->m_item->window, m_currentGdkCursor.GetCursor() );
}
node = node->Next();
}
}
UpdateWindowUI();
}
#endif

View File

@ -564,7 +564,7 @@ bool wxHtmlSearchStatus::Search()
if (m_Engine.Scan(file -> GetStream())) {
m_Name = m_Data->m_Contents[i].m_Name;
m_ContentsItem = m_Data->m_Contents + i;
found = true;
found = TRUE;
}
}
delete file;