// main decoding loop. searches IFF chunks and handles them.
// terminates when BODY chunk was found or dataptr ran over end of file
//
- bool BMHDok = false, CMAPok = false, CAMGok = false;
+ bool BMHDok = false, CAMGok = false;
int bmhd_width = 0, bmhd_height = 0, bmhd_bitplanes = 0, bmhd_transcol = -1;
- byte bmhd_masking = 0, bmhd_compression = 0;
+ byte bmhd_compression = 0;
long camg_viewmode = 0;
int colors = 0;
while (dataptr + 8 <= dataend) {
// get chunk length and make even
- size_t chunkLen = (iff_getlong(dataptr + 4) + 1) & 0xfffffffe;
-#ifdef __VMS
- // Silence compiler warning
- int chunkLen_;
- chunkLen_ = chunkLen;
- if (chunkLen_ < 0) { // format error?
-#else
- if (chunkLen < 0) { // format error?
-#endif
+ long chunkLen = (iff_getlong(dataptr + 4) + 1) & 0xfffffffe;
+ if (chunkLen < 0) { // format error?
break;
}
bool truncated = (dataptr + 8 + chunkLen > dataend);
bmhd_width = iff_getword(dataptr + 8); // width of picture
bmhd_height= iff_getword(dataptr + 8 + 2); // height of picture
bmhd_bitplanes = *(dataptr + 8 + 8); // # of bitplanes
- bmhd_masking = *(dataptr + 8 + 9);
+ // bmhd_masking = *(dataptr + 8 + 9); -- unused currently
bmhd_compression = *(dataptr + 8 + 10); // get compression
bmhd_transcol = iff_getword(dataptr + 8 + 12);
BMHDok = true; // got BMHD
wxLogTrace(_T("iff"), _T("Read %d colors from IFF file."),
colors);
- CMAPok = true; // got CMAP
dataptr += 8 + chunkLen; // to next chunk
} else if (strncmp((char *)dataptr, "CAMG", 4) == 0) { // CAMG ?
if (chunkLen < 4 || truncated) {
void wxFlexGridSizer::RecalcSizes()
{
- int nitems, nrows, ncols;
- if ( (nitems = CalcRowsCols(nrows, ncols)) == 0 )
+ int nrows, ncols;
+ if ( !CalcRowsCols(nrows, ncols) )
return;
const wxPoint pt(GetPosition());
if (top->GetSizer())
{
// we have just set the size hints...
- wxSize sz = top->GetSizer()->CalcMin();
+ wxSize szClient = top->GetSizer()->CalcMin();
// use SetClientSize() and not SetSize() otherwise the size for
// e.g. a wxFrame with a menubar wouldn't be correctly set
- top->SetClientSize(sz);
+ top->SetClientSize(szClient);
}
else
top->Layout();
// wxFileListCtrl
//-----------------------------------------------------------------------------
-// FIXME: what is this for? It's never read
-static bool ignoreChanges = false;
-
IMPLEMENT_DYNAMIC_CLASS(wxFileListCtrl,wxListCtrl)
BEGIN_EVENT_TABLE(wxFileListCtrl,wxListCtrl)
long id = FindItem( 0, fname );
if (id != wxNOT_FOUND)
{
- ignoreChanges = true;
SetItemState( id, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
EnsureVisible( id );
- ignoreChanges = false;
}
}
}
m_dirName = dir;
UpdateFiles();
- ignoreChanges = true;
SetItemState( 0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
- ignoreChanges = false;
EnsureVisible( 0 );
}
{
fd->SetNewName( new_name, event.GetLabel() );
- ignoreChanges = true;
SetItemState( event.GetItem(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
- ignoreChanges = false;
UpdateItem( event.GetItem() );
EnsureVisible( event.GetItem() );
if ( m_xScrollPosition != xScrollOld )
{
- wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, m_xScrollPosition,
+ wxScrollWinEvent evt(wxEVT_SCROLLWIN_THUMBTRACK, m_xScrollPosition,
wxHORIZONTAL);
- event.SetEventObject(m_win);
- m_win->GetEventHandler()->ProcessEvent(event);
+ evt.SetEventObject(m_win);
+ m_win->GetEventHandler()->ProcessEvent(evt);
}
if ( m_yScrollPosition != yScrollOld )
{
- wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, m_yScrollPosition,
+ wxScrollWinEvent evt(wxEVT_SCROLLWIN_THUMBTRACK, m_yScrollPosition,
wxVERTICAL);
- event.SetEventObject(m_win);
- m_win->GetEventHandler()->ProcessEvent(event);
+ evt.SetEventObject(m_win);
+ m_win->GetEventHandler()->ProcessEvent(evt);
}
}
m_text = new wxSearchTextCtrl(this, value, style & ~wxBORDER_MASK);
m_text->SetDescriptiveText(_("Search"));
- wxSize sizeText = m_text->GetBestSize();
-
m_searchButton = new wxSearchButton(this,
wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN,
m_searchBitmap);
// fire an event
wxCollapsiblePaneEvent ev(p, p->GetId(), p->IsCollapsed());
p->GetEventHandler()->ProcessEvent(ev);
-
+
// the user asked to explicitely handle the resizing itself...
return;
}
if ( top && top->GetSizer() )
{
// 2) recalculate minimal size of the top window
- wxSize sz = top->GetSizer()->CalcMin();
+ sz = top->GetSizer()->CalcMin();
if (top->m_mainWidget)
{
}
return count;
}
-
- return 0;
}
void wxComboBox::SetSelection( int n )
}
else
return index;
-};
+}
//-----------------------------------------------------------------------------
// end wxGtkFileChooser Implementation
alpha1 = 0.0;
alpha2 = 360.0;
}
- else
- if (radius == 0.0)
+ else if ( wxIsNullDouble(radius) )
{
- alpha1 = alpha2 = 0.0;
+ alpha1 =
+ alpha2 = 0.0;
}
else
{
int i;
for (i = 1; i < n; i++)
{
- int x = points[i].x + xoffset;
- int y = points[i].y + yoffset;
+ x = points[i].x + xoffset;
+ y = points[i].y + yoffset;
gs_libGnomePrint->gnome_print_lineto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
CalcBoundingBox( x, y );
}
int i;
for (i = 1; i < n; i++)
{
- int x = points[i].x + xoffset;
- int y = points[i].y + yoffset;
+ x = points[i].x + xoffset;
+ y = points[i].y + yoffset;
gs_libGnomePrint->gnome_print_lineto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
CalcBoundingBox( x, y );
}
{
const int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL;
const int value = win->GetThumbPosition();
- wxScrollEvent event(eventType, win->GetId(), value, orient);
- event.SetEventObject(win);
- win->GetEventHandler()->ProcessEvent(event);
+ const int id = win->GetId();
+
+ // first send the specific event for the user action
+ wxScrollEvent evtSpec(eventType, id, value, orient);
+ evtSpec.SetEventObject(win);
+ win->GetEventHandler()->ProcessEvent(evtSpec);
+
if (!win->m_isScrolling)
{
- wxScrollEvent event(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient);
- event.SetEventObject(win);
- win->GetEventHandler()->ProcessEvent(event);
+ // and if it's over also send a general "changed" event
+ wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient);
+ evtChanged.SetEventObject(win);
+ win->GetEventHandler()->ProcessEvent(evtChanged);
}
}
}
const int value = win->GetThumbPosition();
const int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL;
+ const int id = win->GetId();
- wxScrollEvent event(wxEVT_SCROLL_THUMBRELEASE, win->GetId(), value, orient);
- event.SetEventObject(win);
- win->GetEventHandler()->ProcessEvent(event);
+ wxScrollEvent evtRel(wxEVT_SCROLL_THUMBRELEASE, id, value, orient);
+ evtRel.SetEventObject(win);
+ win->GetEventHandler()->ProcessEvent(evtRel);
- wxScrollEvent event2(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient);
- event2.SetEventObject(win);
- win->GetEventHandler()->ProcessEvent(event2);
+ wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient);
+ evtChanged.SetEventObject(win);
+ win->GetEventHandler()->ProcessEvent(evtChanged);
}
}
}
// if we have a dropdown menu, we use 2 GTK tools internally
wxToolBarToolsList::compatibility_iterator node = m_tools.Item( i );
- wxToolBarTool *tool = (wxToolBarTool*) node->GetData();
- if ( tool->IsButton() && (tool->GetKind() == wxITEM_DROPDOWN) )
+ wxToolBarTool * const tool2 = (wxToolBarTool*) node->GetData();
+ if ( tool2->IsButton() && tool2->GetKind() == wxITEM_DROPDOWN )
posGtk++;
}
}
for (size_t i = 0; i < tabs.GetCount(); i++)
tagname += wxString::Format(_T(" %d"), tabs[i]);
- const wxWX2MBbuf buf = tagname.mb_str(wxConvUTF8);
+ const wxWX2MBbuf buftag = tagname.utf8_str();
tag = gtk_text_tag_table_lookup( gtk_text_buffer_get_tag_table( text_buffer ),
- buf );
+ buftag );
if (!tag)
{
// Factor to convert from 1/10th of a mm into pixels
PangoTabArray* tabArray = pango_tab_array_new(tabs.GetCount(), TRUE);
for (size_t i = 0; i < tabs.GetCount(); i++)
pango_tab_array_set_tab(tabArray, i, PANGO_TAB_LEFT, (gint)(tabs[i] * factor));
- tag = gtk_text_buffer_create_tag( text_buffer, buf,
+ tag = gtk_text_buffer_create_tag( text_buffer, buftag,
"tabs", tabArray, NULL );
pango_tab_array_free(tabArray);
}
{
wxCHECK_MSG( m_text != NULL, wxEmptyString, wxT("invalid text ctrl") );
- wxString tmp;
if ( IsMultiLine() )
{
GtkTextIter start;
const gchar *text = gtk_entry_get_text( GTK_ENTRY(m_text) );
return wxGTK_CONV_BACK(text);
}
-
- return tmp;
}
wxFontEncoding wxTextCtrl::GetTextEncoding() const
const int orient = wxWindow::OrientFromScrollDir(
win->ScrollDirFromRange(range));
- wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBRELEASE, win->GetScrollPos(orient), orient);
- event.SetEventObject(win);
- win->GTKProcessEvent(event);
+ wxScrollWinEvent evt(wxEVT_SCROLLWIN_THUMBRELEASE,
+ win->GetScrollPos(orient), orient);
+ evt.SetEventObject(win);
+ win->GTKProcessEvent(evt);
}
}
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#include "wx/app.h"
-#include "wx/log.h"
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/app.h"
+ #include "wx/log.h"
+#endif
+
#include "wx/evtloop.h"
#include <signal.h>