git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24196
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
62 files changed:
{
bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA);
{
bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA);
- wxBoxSizer *box = NULL;
-
// If we have a PDA screen, put yes/no button over
// all other buttons, otherwise on the left side.
// If we have a PDA screen, put yes/no button over
// all other buttons, otherwise on the left side.
- if (is_pda)
- box = new wxBoxSizer( wxVERTICAL );
- else
- box = new wxBoxSizer( wxHORIZONTAL );
+ wxBoxSizer *box = is_pda ? new wxBoxSizer( wxVERTICAL ) : new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer *inner_yes_no = NULL;
wxBoxSizer *inner_yes_no = NULL;
// ...since it will be deleted by wxWindows if we return TRUE.
if (m_childView)
{
// ...since it will be deleted by wxWindows if we return TRUE.
if (m_childView)
{
- bool ans = FALSE;
- if (!event.CanVeto())
- ans = TRUE; // Must delete.
- else
- ans = m_childView->Close(FALSE); // FALSE means don't delete associated window
+ bool ans = event.CanVeto()
+ ? m_childView->Close(FALSE) // FALSE means don't delete associated window
+ : TRUE; // Must delete.
if (printout)
{
// Pass two printout objects: for preview, and possible printing.
if (printout)
{
// Pass two printout objects: for preview, and possible printing.
- wxPrintPreviewBase *preview = (wxPrintPreviewBase *) NULL;
- preview = new wxPrintPreview(printout, view->OnCreatePrintout());
+ wxPrintPreviewBase *preview = new wxPrintPreview(printout, view->OnCreatePrintout());
wxPreviewFrame *frame = new wxPreviewFrame(preview, (wxFrame *)wxTheApp->GetTopWindow(), _("Print Preview"),
wxPoint(100, 100), wxSize(600, 650));
wxPreviewFrame *frame = new wxPreviewFrame(preview, (wxFrame *)wxTheApp->GetTopWindow(), _("Print Preview"),
wxPoint(100, 100), wxSize(600, 650));
- wxDocTemplate *temp = (wxDocTemplate *) NULL;
wxString path2(wxT(""));
if (path != wxT(""))
wxString path2(wxT(""));
if (path != wxT(""))
- bool ans = FALSE;
- if (!event.CanVeto())
- ans = TRUE; // Must delete.
- else
- ans = m_childView->Close(FALSE); // FALSE means don't delete associated window
+ bool ans = event.CanVeto()
+ ? m_childView->Close(FALSE) // FALSE means don't delete associated window
+ : TRUE; // Must delete.
// Get the logical pixels per inch of screen and printer
int ppiScreenX, ppiScreenY;
GetPPIScreen(&ppiScreenX, &ppiScreenY);
// Get the logical pixels per inch of screen and printer
int ppiScreenX, ppiScreenY;
GetPPIScreen(&ppiScreenX, &ppiScreenY);
+ wxUnusedVar(ppiScreenY);
int ppiPrinterX, ppiPrinterY;
GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
int ppiPrinterX, ppiPrinterY;
GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
+ wxUnusedVar(ppiPrinterY);
// This scales the DC so that the printout roughly represents the
// the screen scaling. The text point size _should_ be the right size
// This scales the DC so that the printout roughly represents the
// the screen scaling. The text point size _should_ be the right size
int w, h;
dc->GetSize(&w, &h);
GetPageSizePixels(&pageWidth, &pageHeight);
int w, h;
dc->GetSize(&w, &h);
GetPageSizePixels(&pageWidth, &pageHeight);
+ wxUnusedVar(pageHeight);
// If printer pageWidth == current DC width, then this doesn't
// change. But w might be the preview bitmap width, so scale down.
// If printer pageWidth == current DC width, then this doesn't
// change. But w might be the preview bitmap width, so scale down.
bool failed = FALSE;
void *symbol = 0;
bool failed = FALSE;
void *symbol = 0;
#if defined(__WXMAC__) && !defined(__DARWIN__)
Ptr symAddress;
CFragSymbolClass symClass;
#if defined(__WXMAC__) && !defined(__DARWIN__)
Ptr symAddress;
CFragSymbolClass symClass;
bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_enc, int method)
{
unsigned i;
bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_enc, int method)
{
unsigned i;
- wxUint16 *in_tbl = NULL, *out_tbl = NULL;
+ wxUint16 *in_tbl, *out_tbl = NULL;
if (m_Table) {delete[] m_Table; m_Table = NULL;}
if (m_Table) {delete[] m_Table; m_Table = NULL;}
wxChar buf[_MAXPATHLEN];
wxStrcpy(buf, wxFileFunctionsBuffer);
wxChar buf[_MAXPATHLEN];
wxStrcpy(buf, wxFileFunctionsBuffer);
- wxChar *filename = (wxChar*) NULL; /* shut up buggy egcs warning */
- filename = wxIsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (wxChar *)buf;
+ wxChar *filename = wxIsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (wxChar *)buf;
for (wxStringList::compatibility_iterator node = GetFirst(); node; node = node->GetNext())
{
for (wxStringList::compatibility_iterator node = GetFirst(); node; node = node->GetNext())
{
#endif
// Handle environment
#endif
// Handle environment
- const wxChar *val = (const wxChar *) NULL;
- wxChar *tcp = (wxChar *) NULL;
if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL &&
(tcp = wxStrstr (dest, val)) != NULL)
{
if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL &&
(tcp = wxStrstr (dest, val)) != NULL)
{
#endif
// Handle User's home (ignore root homes!)
#endif
// Handle User's home (ignore root homes!)
if ((val = wxGetUserHome (user)) != NULL &&
(len = wxStrlen(val)) > 2 &&
wxStrncmp(dest, val, len) == 0)
if ((val = wxGetUserHome (user)) != NULL &&
(len = wxStrlen(val)) > 2 &&
wxStrncmp(dest, val, len) == 0)
if ( !wxGetTempFileName( wxT("cat"), outfile) )
return FALSE;
if ( !wxGetTempFileName( wxT("cat"), outfile) )
return FALSE;
- FILE *fp1 = (FILE *) NULL;
- FILE *fp2 = (FILE *) NULL;
- FILE *fp3 = (FILE *) NULL;
+ FILE *fp1 wxDUMMY_INITIALIZE(NULL);
+ FILE *fp2 wxDUMMY_INITIALIZE(NULL);
+ FILE *fp3 wxDUMMY_INITIALIZE(NULL);
// Open the inputs and outputs
if ((fp1 = wxFopen ( file1, wxT("rb"))) == NULL ||
(fp2 = wxFopen ( file2, wxT("rb"))) == NULL ||
// Open the inputs and outputs
if ((fp1 = wxFopen ( file1, wxT("rb"))) == NULL ||
(fp2 = wxFopen ( file2, wxT("rb"))) == NULL ||
switch (flags)
{
case wxDIR: dirFlags = wxDIR_DIRS; break;
switch (flags)
{
case wxDIR: dirFlags = wxDIR_DIRS; break;
buf = new wxChar[sz + 1];
}
buf = new wxChar[sz + 1];
}
+ bool ok wxDUMMY_INITIALIZE(FALSE);
// for the compilers which have Unicode version of _getcwd(), call it
// directly, for the others call the ANSI version and do the translation
// for the compilers which have Unicode version of _getcwd(), call it
// directly, for the others call the ANSI version and do the translation
SetTransferMode(oldTransfermode);
}
SetTransferMode(oldTransfermode);
}
- if ( !ok ) // this is not a direct else clause.. The size command might return an invalid "2yz" reply
+ // this is not a direct else clause.. The size command might return an
+ // invalid "2yz" reply
+ if ( !ok )
{
// The server didn't understand the "SIZE"-command or it
// returned an invalid reply.
{
// The server didn't understand the "SIZE"-command or it
// returned an invalid reply.
if ( wxSscanf(fileList[i].c_str(),
_T("%*s %*s %*s %*s %i %*s %*s %*s %*s"),
if ( wxSscanf(fileList[i].c_str(),
_T("%*s %*s %*s %*s %i %*s %*s %*s %*s"),
- &filesize) == 9 )
- {
- // We've gotten a good response
- ok = TRUE;
- }
- else
{
// Hmm... Invalid response
wxLogTrace(FTP_TRACE_MASK,
{
// Hmm... Invalid response
wxLogTrace(FTP_TRACE_MASK,
{
if ( wxSscanf(fileList[i].c_str(),
_T("%*s %*s %i %*s"),
{
if ( wxSscanf(fileList[i].c_str(),
_T("%*s %*s %i %*s"),
- &filesize) == 4 )
- {
- // valid response
- ok = TRUE;
- }
- else
{
// something bad happened..?
wxLogTrace(FTP_TRACE_MASK,
{
// something bad happened..?
wxLogTrace(FTP_TRACE_MASK,
wxUint16 aWord;
// allocate space for palette if needed:
wxUint16 aWord;
// allocate space for palette if needed:
- int line = 0;
- int column = 0;
int linesize = ((width * bpp + 31) / 32) * 4;
/* BMPs are stored upside down */
int linesize = ((width * bpp + 31) / 32) * 4;
/* BMPs are stored upside down */
- for ( line = (height - 1); line >= 0; line-- )
+ for ( int line = (height - 1); line >= 0; line-- )
- for ( column = 0; column < width ; )
+ for ( int column = 0; column < width ; )
linepos++;
aByte = stream.GetC();
if ( bpp == 1 )
{
linepos++;
aByte = stream.GetC();
if ( bpp == 1 )
{
- int bit = 0;
- for (bit = 0; bit < 8 && column < width; bit++)
+ for (int bit = 0; bit < 8 && column < width; bit++)
- index = ((aByte & (0x80 >> bit)) ? 1 : 0);
+ int index = ((aByte & (0x80 >> bit)) ? 1 : 0);
ptr[poffset] = cmap[index].r;
ptr[poffset + 1] = cmap[index].g;
ptr[poffset + 2] = cmap[index].b;
ptr[poffset] = cmap[index].r;
ptr[poffset + 1] = cmap[index].g;
ptr[poffset + 2] = cmap[index].b;
- int nibble = 0;
- for (nibble = 0; nibble < 2 && column < width; nibble++)
+ for (int nibble = 0; nibble < 2 && column < width; nibble++)
- index = ((aByte & (0xF0 >> nibble * 4)) >> (!nibble * 4));
+ int index = ((aByte & (0xF0 >> nibble * 4)) >> (!nibble * 4));
if ( index >= 16 )
index = 15;
ptr[poffset] = cmap[index].r;
if ( index >= 16 )
index = 15;
ptr[poffset] = cmap[index].r;
w3 * *(v3++) + w4 * *(v4++)) /
(w1 + w2 + w3 + w4) );
*(dst++) = (unsigned char)
w3 * *(v3++) + w4 * *(v4++)) /
(w1 + w2 + w3 + w4) );
*(dst++) = (unsigned char)
- ( (w1 * *(v1++) + w2 * *(v2++) +
- w3 * *(v3++) + w4 * *(v4++)) /
+ ( (w1 * *v1 + w2 * *v2 +
+ w3 * *v3 + w4 * *v4) /
(w1 + w2 + w3 + w4) );
}
}
(w1 + w2 + w3 + w4) );
}
}
unsigned char *p = data[ys] + (3 * xs);
*(dst++) = *(p++);
*(dst++) = *(p++);
unsigned char *p = data[ys] + (3 * xs);
*(dst++) = *(p++);
*(dst++) = *(p++);
cinfo->src = (struct jpeg_source_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
sizeof(my_source_mgr));
cinfo->src = (struct jpeg_source_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
sizeof(my_source_mgr));
- src = (my_src_ptr) cinfo->src;
}
src = (my_src_ptr) cinfo->src;
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
}
src = (my_src_ptr) cinfo->src;
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
case Transparency_Mask:
if ( IsTransparent(a) )
{
case Transparency_Mask:
if ( IsTransparent(a) )
{
- // if we couldn't find a unique colour for the mask, we
- // can have real pixels with the same value as the mask
- // and it's better to slightly change their colour than
- // to make them transparent
- if ( r == rMask && g == gMask && b == bMask )
- {
- r++;
- }
-
*ptrDst++ = rMask;
*ptrDst++ = bMask;
*ptrDst++ = gMask;
break;
}
*ptrDst++ = rMask;
*ptrDst++ = bMask;
*ptrDst++ = gMask;
break;
}
- // else: !transparent
-
- // must be opaque then as otherwise we shouldn't be
- // using the mask at all
- wxASSERT_MSG( IsOpaque(a), _T("logic error") );
+ else // !transparent
+ {
+ // must be opaque then as otherwise we shouldn't be
+ // using the mask at all
+ wxASSERT_MSG( IsOpaque(a), _T("logic error") );
+
+ // if we couldn't find a unique colour for the
+ // mask, we can have real pixels with the same
+ // value as the mask and it's better to slightly
+ // change their colour than to make them
+ // transparent
+ if ( r == rMask && g == gMask && b == bMask )
+ {
+ r++;
+ }
+ }
+ int codepage
+ #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
+ = -1
+ #endif
+ ;
wxUint32 lcid = MAKELCID(MAKELANGID(info->WinLang, info->WinSublang),
SORT_DEFAULT);
// FIXME
wxUint32 lcid = MAKELCID(MAKELANGID(info->WinLang, info->WinSublang),
SORT_DEFAULT);
// FIXME
int actualWidth = (int)(zoomScale*m_pageWidth*m_previewScale);
int actualHeight = (int)(zoomScale*m_pageHeight*m_previewScale);
int actualWidth = (int)(zoomScale*m_pageWidth*m_previewScale);
int actualHeight = (int)(zoomScale*m_pageHeight*m_previewScale);
- int x = (int)((canvasWidth - actualWidth)/2.0);
- if (x < m_leftMargin)
- x = m_leftMargin;
- // int y = m_topMargin;
-
-
if (!m_previewBitmap)
{
m_previewBitmap = new wxBitmap((int)actualWidth, (int)actualHeight);
if (!m_previewBitmap)
{
m_previewBitmap = new wxBitmap((int)actualWidth, (int)actualHeight);
{
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
hist3d histogram = cquantize->histogram;
{
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
hist3d histogram = cquantize->histogram;
if (is_pre_scan) {
/* Set up method pointers */
if (is_pre_scan) {
/* Set up method pointers */
cquantize->pub.color_quantize = pass2_fs_dither;
cquantize->pub.finish_pass = finish_pass2;
cquantize->pub.color_quantize = pass2_fs_dither;
cquantize->pub.finish_pass = finish_pass2;
- /* Make sure color count is acceptable */
- i = cinfo->actual_number_of_colors;
-
{
size_t arraysize = (size_t) ((cinfo->output_width + 2) *
(3 * sizeof(FSERROR)));
{
size_t arraysize = (size_t) ((cinfo->output_width + 2) *
(3 * sizeof(FSERROR)));
}
/* Zero the histogram or inverse color map, if necessary */
if (cquantize->needs_zeroed) {
}
/* Zero the histogram or inverse color map, if necessary */
if (cquantize->needs_zeroed) {
- for (i = 0; i < HIST_C0_ELEMS; i++) {
+ for (int i = 0; i < HIST_C0_ELEMS; i++) {
memset((void *) histogram[i], 0,
HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));
}
memset((void *) histogram[i], 0,
HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));
}
- int w = src.GetWidth();
- int h = src.GetHeight();
int windowsSystemColourCount = 20;
int windowsSystemColourCount = 20;
#endif
// create rows info:
#endif
// create rows info:
+ int h = src.GetHeight();
+ int w = src.GetWidth();
unsigned char **rows = new unsigned char *[h];
unsigned char **rows = new unsigned char *[h];
- h = src.GetHeight(), w = src.GetWidth();
unsigned char *imgdt = src.GetData();
for (i = 0; i < h; i++)
rows[i] = imgdt + 3/*RGB*/ * w * i;
unsigned char *imgdt = src.GetData();
for (i = 0; i < h; i++)
rows[i] = imgdt + 3/*RGB*/ * w * i;
wxDataInputStream *codeci;
wxDataOutputStream *codeco;
wxSocketStream *sockstrm;
wxDataInputStream *codeci;
wxDataOutputStream *codeco;
wxSocketStream *sockstrm;
codeci = connection->m_codeci;
codeco = connection->m_codeco;
sockstrm = connection->m_sockstrm;
codeci = connection->m_codeci;
codeco = connection->m_codeco;
sockstrm = connection->m_sockstrm;
+ int msg = codeci->Read8();
wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
{
int total;
wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
{
int total;
// Try the pushback buffer first
total = GetPushback(buffer, nbytes, FALSE);
// Try the pushback buffer first
total = GetPushback(buffer, nbytes, FALSE);
// wxSOCKET_BLOCK
// wxSOCKET_NONE
//
// wxSOCKET_BLOCK
// wxSOCKET_NONE
//
if (m_flags & wxSOCKET_NOWAIT)
{
GSocket_SetNonBlocking(m_socket, 1);
if (m_flags & wxSOCKET_NOWAIT)
{
GSocket_SetNonBlocking(m_socket, 1);
wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes)
{
wxUint32 total = 0;
wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes)
{
wxUint32 total = 0;
// If the socket is invalid or parameters are ill, return immediately
if (!m_socket || !buffer || !nbytes)
// If the socket is invalid or parameters are ill, return immediately
if (!m_socket || !buffer || !nbytes)
// wxSOCKET_BLOCK
// wxSOCKET_NONE
//
// wxSOCKET_BLOCK
// wxSOCKET_NONE
//
if (m_flags & wxSOCKET_NOWAIT)
{
GSocket_SetNonBlocking(m_socket, 1);
if (m_flags & wxSOCKET_NOWAIT)
{
GSocket_SetNonBlocking(m_socket, 1);
// Schedule the event
wxSocketEventFlags flag = 0;
// Schedule the event
wxSocketEventFlags flag = 0;
switch (notification)
{
case GSOCK_INPUT: flag = GSOCK_INPUT_FLAG; break;
switch (notification)
{
case GSOCK_INPUT: flag = GSOCK_INPUT_FLAG; break;
- if (output) *output++ = (wxUint16) input;
+ if (output)
+ *output = (wxUint16) input;
return 1;
}
else if (input>=0x110000)
return 1;
}
else if (input>=0x110000)
if (output)
{
*output++ = (wxUint16) ((input >> 10)+0xd7c0);
if (output)
{
*output++ = (wxUint16) ((input >> 10)+0xd7c0);
- *output++ = (wxUint16) ((input&0x3ff)+0xdc00);
+ *output = (wxUint16) ((input&0x3ff)+0xdc00);
if ( !HasBuffer() && m_fixed )
{
if ( !HasBuffer() && m_fixed )
{
wxChar wxTextInputStream::NextNonSeparators()
{
wxChar wxTextInputStream::NextNonSeparators()
{
if (c == wxEOT) return (wxChar) 0;
if (c != wxT('\n') &&
if (c == wxEOT) return (wxChar) 0;
if (c != wxT('\n') &&
wxInputStream *wxURL::GetInputStream()
{
wxInputStream *wxURL::GetInputStream()
{
- wxInputStream *the_i_stream = NULL;
-
if (!m_protocol)
{
m_error = wxURL_NOPROTO;
if (!m_protocol)
{
m_error = wxURL_NOPROTO;
#endif
// When we use a proxy, we have to pass the whole URL to it.
#endif
// When we use a proxy, we have to pass the whole URL to it.
- if (m_useProxy)
- the_i_stream = m_protocol->GetInputStream(m_url);
- else
- the_i_stream = m_protocol->GetInputStream(m_path);
+ wxInputStream *the_i_stream =
+ (m_useProxy) ? m_protocol->GetInputStream(m_url) :
+ m_protocol->GetInputStream(m_path);
default : nextpos = m_Pos; break; /* just to fool compiler, never happens */
}
default : nextpos = m_Pos; break; /* just to fool compiler, never happens */
}
if ( nextpos > m_Pos )
{
toskip = nextpos - m_Pos;
if ( nextpos > m_Pos )
{
toskip = nextpos - m_Pos;
bool wxCalendarCtrl::IsDateInRange(const wxDateTime& date) const
{
bool wxCalendarCtrl::IsDateInRange(const wxDateTime& date) const
{
// Check if the given date is in the range specified
// Check if the given date is in the range specified
- retval = ( ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : TRUE )
+ return ( ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : TRUE )
&& ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : TRUE ) );
&& ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : TRUE ) );
}
bool wxCalendarCtrl::ChangeYear(wxDateTime* target) const
}
bool wxCalendarCtrl::ChangeYear(wxDateTime* target) const
- day += ( startOnMonday ) ? 0 : 1;
+ *day += ( startOnMonday ) ? 0 : 1;
}
int targetmonth = date.GetMonth() + (12 * date.GetYear());
}
int targetmonth = date.GetMonth() + (12 * date.GetYear());
{
whichKind = 2;
colourSelection = i;
{
whichKind = 2;
colourSelection = i;
- initColourFound = TRUE;
{
// Now, a negative radius is interpreted to mean
// 'the proportion of the smallest X or Y dimension'
{
// Now, a negative radius is interpreted to mean
// 'the proportion of the smallest X or Y dimension'
- double smallest = 0.0;
- if (width < height)
- smallest = width;
- else
- smallest = height;
+ double smallest = width < height ? width : height;
radius = (-radius * smallest);
}
radius = (-radius * smallest);
}
case wxSCRIPT:
{
name = "/ZapfChancery-MediumItalic";
case wxSCRIPT:
{
name = "/ZapfChancery-MediumItalic";
- Style = wxNORMAL;
- Weight = wxNORMAL;
static const char *wxCoord_dashed = "[4 8] 2";
static const char *dotted_dashed = "[6 6 2 6] 4";
static const char *wxCoord_dashed = "[4 8] 2";
static const char *dotted_dashed = "[6 6 2 6] 4";
- const char *psdash = (char *) NULL;
switch (m_pen.GetStyle())
{
case wxDOT: psdash = dotted; break;
switch (m_pen.GetStyle())
{
case wxDOT: psdash = dotted; break;
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 );
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 );
- while ((node = node->GetNext()))
+ node = node->GetNext();
+ while (node)
{
q = (wxPoint *)node->GetData();
{
q = (wxPoint *)node->GetData();
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 );
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 );
+
+ node = node->GetNext();
lastStyle = Style;
lastWeight = Weight;
lastStyle = Style;
lastWeight = Weight;
- const wxChar *name = NULL;
case wxSCRIPT:
{
name = wxT("Zapf.afm");
case wxSCRIPT:
{
name = wxT("Zapf.afm");
- Style = wxNORMAL;
- Weight = wxNORMAL;
path.Printf(wxT("%c:\\"), driveBuffer[i]);
name.Printf(wxT("%c:"), driveBuffer[i]);
path.Printf(wxT("%c:\\"), driveBuffer[i]);
name.Printf(wxT("%c:"), driveBuffer[i]);
- int imageId = wxFileIconsTable::drive;
int driveType = ::GetDriveType(path);
switch (driveType)
{
int driveType = ::GetDriveType(path);
switch (driveType)
{
if (n > 0 && defaultFilter < (int) n)
{
if (n > 0 && defaultFilter < (int) n)
{
- size_t i = 0;
- for (i = 0; i < n; i++)
+ for (size_t i = 0; i < n; i++)
Append(descriptions[i]);
SetSelection(defaultFilter);
}
Append(descriptions[i]);
SetSelection(defaultFilter);
}
FreeAllItemsData();
DeleteAllItems();
FreeAllItemsData();
DeleteAllItems();
- wxFileData *fd = (wxFileData *) NULL;
wxListItem item;
item.m_itemId = 0;
item.m_col = 0;
wxListItem item;
item.m_itemId = 0;
item.m_col = 0;
for (n=0; n<count; n++)
{
for (n=0; n<count; n++)
{
- fd = new wxFileData(paths[n], names[n], wxFileData::is_drive, icons[n]);
+ wxFileData *fd = new wxFileData(paths[n], names[n], wxFileData::is_drive, icons[n]);
Add(fd, item);
item.m_itemId++;
}
Add(fd, item);
item.m_itemId++;
}
#ifdef __UNIX__
if (p.IsEmpty()) p = wxT("/");
#endif // __UNIX__
#ifdef __UNIX__
if (p.IsEmpty()) p = wxT("/");
#endif // __UNIX__
- fd = new wxFileData(p, wxT(".."), wxFileData::is_dir, wxFileIconsTable::folder);
+ wxFileData *fd = new wxFileData(p, wxT(".."), wxFileData::is_dir, wxFileIconsTable::folder);
Add(fd, item);
item.m_itemId++;
}
Add(fd, item);
item.m_itemId++;
}
cont = dir.GetFirst(&f, wxEmptyString, wxDIR_DIRS | hiddenFlag);
while (cont)
{
cont = dir.GetFirst(&f, wxEmptyString, wxDIR_DIRS | hiddenFlag);
while (cont)
{
- fd = new wxFileData(dirPrefix + f, f, wxFileData::is_dir, wxFileIconsTable::folder);
+ wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_dir, wxFileIconsTable::folder);
Add(fd, item);
item.m_itemId++;
cont = dir.GetNext(&f);
Add(fd, item);
item.m_itemId++;
cont = dir.GetNext(&f);
wxDIR_FILES | hiddenFlag);
while (cont)
{
wxDIR_FILES | hiddenFlag);
while (cont)
{
- fd = new wxFileData(dirPrefix + f, f, wxFileData::is_file, wxFileIconsTable::file);
+ wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_file, wxFileIconsTable::file);
Add(fd, item);
item.m_itemId++;
cont = dir.GetNext(&f);
Add(fd, item);
item.m_itemId++;
cont = dir.GetNext(&f);
{
if (!m_useEvents) return;
{
if (!m_useEvents) return;
- int fontFamily = 0; /* shut up buggy egcs warnings */
- fontFamily = wxFontFamilyStringToInt(WXSTRINGCAST familyChoice->GetStringSelection());
- int fontWeight = 0;
- fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection());
- int fontStyle = 0;
- fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection());
+ int fontFamily = wxFontFamilyStringToInt(WXSTRINGCAST familyChoice->GetStringSelection());
+ int fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection());
+ int fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection());
int fontSize = wxAtoi(pointSizeChoice->GetStringSelection());
int fontUnderline = underLineCheckBox->GetValue();
int fontSize = wxAtoi(pointSizeChoice->GetStringSelection());
int fontUnderline = underLineCheckBox->GetValue();
m_previewer->SetFont(dialogFont);
if (colourChoice->GetStringSelection() != wxT(""))
{
m_previewer->SetFont(dialogFont);
if (colourChoice->GetStringSelection() != wxT(""))
{
- wxColour *col = (wxColour*) NULL;
- col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection());
+ wxColour *col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection());
if (col)
{
m_fontData.m_fontColour = *col;
if (col)
{
m_fontData.m_fontColour = *col;
if ( !ms_sizeCheckMark.x )
{
// get checkbox size
if ( !ms_sizeCheckMark.x )
{
// get checkbox size
wxCheckBox *checkbox = new wxCheckBox(&grid, -1, wxEmptyString);
wxSize size = checkbox->GetBestSize();
wxCheckBox *checkbox = new wxCheckBox(&grid, -1, wxEmptyString);
wxSize size = checkbox->GetBestSize();
- checkSize = size.y + 2*wxGRID_CHECKMARK_MARGIN;
+ wxCoord checkSize = size.y + 2*wxGRID_CHECKMARK_MARGIN;
// FIXME wxGTK::wxCheckBox::GetBestSize() gives "wrong" result
#if defined(__WXGTK__) || defined(__WXMOTIF__)
// FIXME wxGTK::wxCheckBox::GetBestSize() gives "wrong" result
#if defined(__WXGTK__) || defined(__WXMOTIF__)
{
//Basicaly implement old version.
//Also check merge cache, so we don't have to re-merge every time..
{
//Basicaly implement old version.
//Also check merge cache, so we don't have to re-merge every time..
- wxGridCellAttr *attrcell = (wxGridCellAttr *)NULL,
- *attrrow = (wxGridCellAttr *)NULL,
- *attrcol = (wxGridCellAttr *)NULL;
-
- attrcell = m_data->m_cellAttrs.GetAttr(row, col);
- attrcol = m_data->m_colAttrs.GetAttr(col);
- attrrow = m_data->m_rowAttrs.GetAttr(row);
+ wxGridCellAttr *attrcell = m_data->m_cellAttrs.GetAttr(row, col);
+ wxGridCellAttr *attrrow = m_data->m_rowAttrs.GetAttr(row);
+ wxGridCellAttr *attrcol = m_data->m_colAttrs.GetAttr(col);
if((attrcell != attrrow) && (attrrow !=attrcol) && (attrcell != attrcol)){
// Two or move are non NULL
if((attrcell != attrrow) && (attrrow !=attrcol) && (attrcell != attrcol)){
// Two or move are non NULL
wxMouseEvent& mouseEv )
{
bool claimed;
wxMouseEvent& mouseEv )
{
bool claimed;
if ( type == wxEVT_GRID_ROW_SIZE || type == wxEVT_GRID_COL_SIZE )
{
if ( type == wxEVT_GRID_ROW_SIZE || type == wxEVT_GRID_COL_SIZE )
{
int row, int col )
{
bool claimed;
int row, int col )
{
bool claimed;
if ( type == wxEVT_GRID_ROW_SIZE || type == wxEVT_GRID_COL_SIZE )
{
if ( type == wxEVT_GRID_ROW_SIZE || type == wxEVT_GRID_COL_SIZE )
{
void wxGrid::SetColFormatCustom(int col, const wxString& typeName)
{
void wxGrid::SetColFormatCustom(int col, const wxString& typeName)
{
- wxGridCellAttr *attr = (wxGridCellAttr *)NULL;
-
- attr = m_table->GetAttr(-1, col, wxGridCellAttr::Col );
+ wxGridCellAttr *attr = m_table->GetAttr(-1, col, wxGridCellAttr::Col );
if(!attr)
attr = new wxGridCellAttr;
wxGridCellRenderer *renderer = GetDefaultRendererForType(typeName);
if(!attr)
attr = new wxGridCellAttr;
wxGridCellRenderer *renderer = GetDefaultRendererForType(typeName);
r = m_grid->BlockToDeviceRect( m_cellSelection[n],
m_cellSelection[n] );
m_cellSelection.RemoveAt(n);
r = m_grid->BlockToDeviceRect( m_cellSelection[n],
m_cellSelection[n] );
m_cellSelection.RemoveAt(n);
if ( !m_grid->GetBatchCount() )
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r );
if ( !m_grid->GetBatchCount() )
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r );
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") );
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") );
- wxBitmap* newBitmap = NULL;
- if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
-#if defined(__VISAGECPP__)
-//just can't do this in VisualAge now, with all this new Bitmap-Icon stuff
-//so construct it from a bitmap object until I can figure this nonsense out. (DW)
- newBitmap = new wxBitmap(bitmap) ;
-#else
- newBitmap = new wxBitmap( (const wxIcon&) bitmap );
-#endif
- else
- newBitmap = new wxBitmap(bitmap) ;
+ wxBitmap* newBitmap = (bitmap.IsKindOf(CLASSINFO(wxIcon))) ?
+ #if defined(__VISAGECPP__)
+ //just can't do this in VisualAge now, with all this new Bitmap-Icon stuff
+ //so construct it from a bitmap object until I can figure this nonsense out. (DW)
+ new wxBitmap(bitmap)
+ #else
+ new wxBitmap( (const wxIcon&) bitmap )
+ #endif
+ : new wxBitmap(bitmap) ;
if (index == (int) m_images.GetCount() - 1)
{
if (index == (int) m_images.GetCount() - 1)
{
{
wxPen pen(GetRuleColour(), 1, wxSOLID);
{
wxPen pen(GetRuleColour(), 1, wxSOLID);
wxRect firstItemRect;
wxRect lastItemRect;
GetItemRect(visibleFrom, firstItemRect);
wxRect firstItemRect;
wxRect lastItemRect;
GetItemRect(visibleFrom, firstItemRect);
int x = firstItemRect.GetX();
dc.SetPen(pen);
dc.SetBrush(* wxTRANSPARENT_BRUSH);
int x = firstItemRect.GetX();
dc.SetPen(pen);
dc.SetBrush(* wxTRANSPARENT_BRUSH);
- for (col = 0; col < GetColumnCount(); col++)
+ for (int col = 0; col < GetColumnCount(); col++)
{
int colWidth = GetColumnWidth(col);
x += colWidth;
{
int colWidth = GetColumnWidth(col);
x += colWidth;
- int steps = 0;
- if ( HasFlag(wxLC_REPORT) )
- {
- steps = m_linesPerPage - 1;
- }
- else
- {
- steps = m_current % m_linesPerPage;
- }
+ int steps = HasFlag(wxLC_REPORT) ? m_linesPerPage - 1 : m_current % m_linesPerPage;
int index = m_current - steps;
if (index < 0)
int index = m_current - steps;
if (index < 0)
- int steps = 0;
- if ( HasFlag(wxLC_REPORT) )
- {
- steps = m_linesPerPage - 1;
- }
- else
- {
- steps = m_linesPerPage - (m_current % m_linesPerPage) - 1;
- }
+ int steps = HasFlag(wxLC_REPORT)
+ ? m_linesPerPage - 1
+ : m_linesPerPage - (m_current % m_linesPerPage) - 1;
size_t index = m_current + steps;
size_t count = GetItemCount();
size_t index = m_current + steps;
size_t count = GetItemCount();
clientHeight -= wxSystemSettings::
GetMetric(wxSYS_HSCROLL_Y);
m_linesPerPage = 0;
clientHeight -= wxSystemSettings::
GetMetric(wxSYS_HSCROLL_Y);
m_linesPerPage = 0;
- currentlyVisibleLines = 0;
-wxListItemAttr *wxGenericListCtrl::OnGetItemAttr(long item) const
+wxListItemAttr *
+wxGenericListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const
{
wxASSERT_MSG( item >= 0 && item < GetItemCount(),
_T("invalid item index in OnGetItemAttr()") );
{
wxASSERT_MSG( item >= 0 && item < GetItemCount(),
_T("invalid item index in OnGetItemAttr()") );
// open file
// ---------
// open file
// ---------
if ( wxFile::Exists(filename) ) {
bool bAppend = FALSE;
wxString strMsg;
if ( wxFile::Exists(filename) ) {
bool bAppend = FALSE;
wxString strMsg;
m_printDialogData.SetMaxPage(9999);
// Create a suitable device context
m_printDialogData.SetMaxPage(9999);
// Create a suitable device context
- wxDC *dc = (wxDC *) NULL;
if (prompt)
{
dc = PrintDialog(parent);
if (prompt)
{
dc = PrintDialog(parent);
if ( edge == wxSASH_LEFT || edge == wxSASH_RIGHT )
{
if ( edge == wxSASH_LEFT || edge == wxSASH_RIGHT )
{
- int sashPosition = 0;
- if (edge == wxSASH_LEFT)
- sashPosition = 0;
- else
- sashPosition = w - GetEdgeMargin(edge);
+ int sashPosition = (edge == wxSASH_LEFT) ? 0 : ( w - GetEdgeMargin(edge) );
dc.SetPen(facePen);
dc.SetBrush(faceBrush);
dc.SetPen(facePen);
dc.SetBrush(faceBrush);
}
else // top or bottom
{
}
else // top or bottom
{
- int sashPosition = 0;
- if (edge == wxSASH_TOP)
- sashPosition = 0;
- else
- sashPosition = h - GetEdgeMargin(edge);
+ int sashPosition = (edge == wxSASH_TOP) ? 0 : ( h - GetEdgeMargin(edge) );
dc.SetPen(facePen);
dc.SetBrush(faceBrush);
dc.SetPen(facePen);
dc.SetBrush(faceBrush);
parent = parent->GetParent();
}
parent = parent->GetParent();
}
wxTopLevelWindow *winTop = wxDynamicCast(parent, wxTopLevelWindow);
if ( winTop )
wxTopLevelWindow *winTop = wxDynamicCast(parent, wxTopLevelWindow);
if ( winTop )
if ( ! IsSplit() )
return FALSE;
if ( ! IsSplit() )
return FALSE;
if ( toRemove == NULL || toRemove == m_windowTwo)
{
win = m_windowTwo ;
if ( toRemove == NULL || toRemove == m_windowTwo)
{
win = m_windowTwo ;
void wxGenericTreeCtrl::SelectItemRange(wxGenericTreeItem *item1, wxGenericTreeItem *item2)
{
void wxGenericTreeCtrl::SelectItemRange(wxGenericTreeItem *item1, wxGenericTreeItem *item2)
{
- // item2 is not necessary after item1
- wxGenericTreeItem *first=NULL, *last=NULL;
+ // item2 is not necessary after item1
// choice first' and 'last' between item1 and item2
// choice first' and 'last' between item1 and item2
- if (item1->GetY()<item2->GetY())
- {
- first=item1;
- last=item2;
- }
- else
- {
- first=item2;
- last=item1;
- }
+ wxGenericTreeItem *first= (item1->GetY()<item2->GetY()) ? item1 : item2;
+ wxGenericTreeItem *last = (item1->GetY()<item2->GetY()) ? item2 : item1;
bool select = m_current->IsSelected();
bool select = m_current->IsSelected();
// flags for DoHandleItemClick()
int flags = ItemClick_Kbd;
// flags for DoHandleItemClick()
int flags = ItemClick_Kbd;
- int current = 0; // just to silent the stupid compiler warnings
switch ( event.GetKeyCode() )
{
case WXK_HOME:
switch ( event.GetKeyCode() )
{
case WXK_HOME:
+ current = 0; // just to silent the stupid compiler warnings
// use the height of the lines we looked as the average
heightTotal = (wxCoord)
// use the height of the lines we looked as the average
heightTotal = (wxCoord)
- (((float)m_heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax);
+ (((float)heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax);
sizer->Add(m_SearchList, 1, wxALL | wxEXPAND, 2);
m_NavigNotebook->AddPage(dummy, _("Search"));
sizer->Add(m_SearchList, 1, wxALL | wxEXPAND, 2);
m_NavigNotebook->AddPage(dummy, _("Search"));
- m_SearchPage = notebook_page++;
+ m_SearchPage = notebook_page;
ypos + line->GetPosY());
line = line->GetNext();
}
ypos + line->GetPosY());
line = line->GetNext();
}
- const wxHtmlCell *r = NULL;
-
for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext())
{
for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext())
{
- r = cell->Find(condition, param);
+ const wxHtmlCell *r = cell->Find(condition, param);
wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source)
{
const wxChar *src = source.c_str();
wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source)
{
const wxChar *src = source.c_str();
int lng = source.Length();
wxChar tagBuffer[256];
int lng = source.Length();
wxChar tagBuffer[256];
{
if (m_CacheSize % CACHE_INCREMENT == 0)
m_Cache = (wxHtmlCacheItem*) realloc(m_Cache, (m_CacheSize + CACHE_INCREMENT) * sizeof(wxHtmlCacheItem));
{
if (m_CacheSize % CACHE_INCREMENT == 0)
m_Cache = (wxHtmlCacheItem*) realloc(m_Cache, (m_CacheSize + CACHE_INCREMENT) * sizeof(wxHtmlCacheItem));
- tg = m_CacheSize++;
- m_Cache[tg].Key = stpos = pos++;
+ int tg = m_CacheSize++;
+ int stpos = pos++;
+ m_Cache[tg].Key = stpos;
int ppiPrinterX, ppiPrinterY;
GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
int ppiPrinterX, ppiPrinterY;
GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
+ wxUnusedVar(ppiPrinterX);
int ppiScreenX, ppiScreenY;
GetPPIScreen(&ppiScreenX, &ppiScreenY);
int ppiScreenX, ppiScreenY;
GetPPIScreen(&ppiScreenX, &ppiScreenY);
+ wxUnusedVar(ppiScreenX);
dc->SetUserScale((double)dc_w / (double)pageWidth, (double)dc_w / (double)pageWidth);
dc->SetUserScale((double)dc_w / (double)pageWidth, (double)dc_w / (double)pageWidth);
static wxString LINKAGEMODE HtmlizeWhitespaces(const wxString& str)
{
wxString out;
static wxString LINKAGEMODE HtmlizeWhitespaces(const wxString& str)
{
wxString out;
- size_t i = 0, j = 0, len = str.Len();
- for (i = 0; i < len; i++)
+ size_t len = str.Len();
+ for (size_t i = 0; i < len; i++)
out << wxT("<br>");
break;
case wxT('\t'):
out << wxT("<br>");
break;
case wxT('\t'):
- for (j = 8 - i%8; j > 0; j--) out << wxT(" ");
+ {
+ for (size_t j = 8 - i%8; j > 0; j--)
+ out << wxT(" ");
+ }
break;
default:
out << str[i];
break;
default:
out << str[i];
HPALETTE hPal, LPBITMAPINFO* lpDIBHeader)
{
unsigned long i, headerSize;
HPALETTE hPal, LPBITMAPINFO* lpDIBHeader)
{
unsigned long i, headerSize;
- LPBITMAPINFO lpDIBheader = NULL;
- LPPALETTEENTRY lpPe = NULL;
-
// Allocate space for a DIB header
headerSize = (sizeof(BITMAPINFOHEADER) + (256 * sizeof(PALETTEENTRY)));
// Allocate space for a DIB header
headerSize = (sizeof(BITMAPINFOHEADER) + (256 * sizeof(PALETTEENTRY)));
- lpDIBheader = (BITMAPINFO *) malloc(headerSize);
- lpPe = (PALETTEENTRY *)((BYTE*)lpDIBheader + sizeof(BITMAPINFOHEADER));
+ LPBITMAPINFO lpDIBheader = (BITMAPINFO *) malloc(headerSize);
+ LPPALETTEENTRY lpPe = (PALETTEENTRY *)((BYTE*)lpDIBheader + sizeof(BITMAPINFOHEADER));
GetPaletteEntries(hPal, 0, 256, lpPe);
GetPaletteEntries(hPal, 0, 256, lpPe);
- double smallest = 0.0;
- if (width < height)
- smallest = width;
- else
- smallest = height;
+ double smallest = (width < height) ? width : height;
radius = (- radius * smallest);
}
radius = (- radius * smallest);
}
if ( m_brush.GetResourceHandle() )
{
if ( m_brush.GetResourceHandle() )
{
- HBRUSH b = 0;
- b = (HBRUSH) ::SelectObject(GetHdc(), (HBRUSH)m_brush.GetResourceHandle());
+ HBRUSH b = (HBRUSH) ::SelectObject(GetHdc(), (HBRUSH)m_brush.GetResourceHandle());
if (!m_oldBrush)
m_oldBrush = (WXHBRUSH) b;
}
if (!m_oldBrush)
m_oldBrush = (WXHBRUSH) b;
}
::SetBkColor(GetHdc(), m_textBackgroundColour.GetPixel() );
}
::SetBkColor(GetHdc(), m_textBackgroundColour.GetPixel() );
}
switch (rop)
{
case wxXOR: dwRop = SRCINVERT; break;
switch (rop)
{
case wxXOR: dwRop = SRCINVERT; break;
// find the entry for this DC in the cache (keyed by the window)
WXHDC wxPaintDC::FindDCInCache(wxWindow* win)
{
// find the entry for this DC in the cache (keyed by the window)
WXHDC wxPaintDC::FindDCInCache(wxWindow* win)
{
- wxPaintDCInfo *info = NULL;
size_t nCache = ms_cache.GetCount();
for ( size_t n = 0; n < nCache; n++ )
{
size_t nCache = ms_cache.GetCount();
for ( size_t n = 0; n < nCache; n++ )
{
+ wxPaintDCInfo *info = &ms_cache[n];
if ( info->hwnd == win->GetHWND() )
{
return info->hdc;
if ( info->hwnd == win->GetHWND() )
{
return info->hdc;
{
#if wxUSE_WXDIB
wxDIB dib(bmp);
{
#if wxUSE_WXDIB
wxDIB dib(bmp);
+ bool ok = dib.IsOk();
+ if ( !ok )
return FALSE;
DIBSECTION ds;
return FALSE;
DIBSECTION ds;
return TRUE;
#else
return FALSE;
return TRUE;
#else
return FALSE;
- return dib.IsOk() && bitmap->CopyFromDIB(dib);
+ bool ok = dib.IsOk() && bitmap->CopyFromDIB(dib);
+ return ok;
#else
WXHBITMAP hBitmap = (WXHBITMAP)wxLoadBMP(name);
if(hBitmap) {
#else
WXHBITMAP hBitmap = (WXHBITMAP)wxLoadBMP(name);
if(hBitmap) {
#include <winsock.h>
#ifndef __GSOCKET_STANDALONE__
#include <winsock.h>
#ifndef __GSOCKET_STANDALONE__
# include "wx/setup.h"
#endif
# include "wx/setup.h"
#endif
#include "wx/dynarray.h"
#include "wx/log.h"
#include "wx/config.h"
#include "wx/dynarray.h"
#include "wx/log.h"
#include "wx/config.h"
#include "wx/msw/iniconf.h"
#include "wx/msw/iniconf.h"
wxCHECK_MSG( !ftInfo.GetExtensions().IsEmpty(), NULL,
_T("Associate() needs extension") );
wxCHECK_MSG( !ftInfo.GetExtensions().IsEmpty(), NULL,
_T("Associate() needs extension") );
int iExtCount = 0 ;
wxString filetype;
wxString extWithDot;
int iExtCount = 0 ;
wxString filetype;
wxString extWithDot;
filetype = filetypeOrig;
}
filetype = filetypeOrig;
}
- ok = key.SetValue(wxEmptyString, filetype);
+ key.SetValue(wxEmptyString, filetype);
if (!filetypeOrig.empty())
{
filetype = filetypeOrig;
if (!filetypeOrig.empty())
{
filetype = filetypeOrig;
- ok = key.SetValue(wxEmptyString, filetype);
+ key.SetValue(wxEmptyString, filetype);
- ok = key.QueryValue(wxEmptyString, filetype);
+ key.QueryValue(wxEmptyString, filetype);
}
}
// now set a mimetypeif we have it, but ignore it if none
}
}
// now set a mimetypeif we have it, but ignore it if none
if ( ok )
{
// and provide a back link to the extension
if ( ok )
{
// and provide a back link to the extension
- ok = keyMIME.SetValue(_T("Extension"), extWithDot);
+ keyMIME.SetValue(_T("Extension"), extWithDot);
extWithDot += ext;
wxRegKey key(wxRegKey::HKCR, extWithDot);
extWithDot += ext;
wxRegKey key(wxRegKey::HKCR, extWithDot);
- if ( !key.Exists() ) ok = key.Create();
- ok = key.SetValue(wxEmptyString, filetype);
+ if ( !key.Exists() ) key.Create();
+ key.SetValue(wxEmptyString, filetype);
// now set any mimetypes we may have, but ignore it if none
const wxString& mimetype = ftInfo.GetMimeType();
// now set any mimetypes we may have, but ignore it if none
const wxString& mimetype = ftInfo.GetMimeType();
if ( ok )
{
// and provide a back link to the extension
if ( ok )
{
// and provide a back link to the extension
- ok = keyMIME.SetValue(_T("Extension"), extWithDot);
+ keyMIME.SetValue(_T("Extension"), extWithDot);
// create the filetype key itself (it will be empty for now, but
// SetCommand(), SetDefaultIcon() &c will use it later)
wxRegKey keyFT(wxRegKey::HKCR, filetype);
// create the filetype key itself (it will be empty for now, but
// SetCommand(), SetDefaultIcon() &c will use it later)
wxRegKey keyFT(wxRegKey::HKCR, filetype);
- wxFileType *ft = NULL;
- ft = CreateFileType(filetype, extWithDot);
+ wxFileType *ft = CreateFileType(filetype, extWithDot);
- COLORREF ms_colour = 0;
- ms_colour = M_PENDATA->m_colour.GetPixel();
+ COLORREF ms_colour = M_PENDATA->m_colour.GetPixel();
// Join style, Cap style, Pen Stippling only on Win32.
// Currently no time to find equivalent on Win3.1, sorry
// Join style, Cap style, Pen Stippling only on Win32.
// Currently no time to find equivalent on Win3.1, sorry
wxWindow* win;
int x, y;
wxGetMousePosition(&x, &y);
wxWindow* win;
int x, y;
wxGetMousePosition(&x, &y);
// Work around a WIN32 bug
::SetForegroundWindow ((HWND) win->GetHWND ());
// Work around a WIN32 bug
::SetForegroundWindow ((HWND) win->GetHWND ());
- rval = win->PopupMenu(menu, 0, 0);
+ bool rval = win->PopupMenu(menu, 0, 0);
// Work around a WIN32 bug
::PostMessage ((HWND) win->GetHWND(),WM_NULL,0,0L);
// Work around a WIN32 bug
::PostMessage ((HWND) win->GetHWND(),WM_NULL,0,0L);
// process the Windows messages that result from these functions
// (note that even in console applications we might have to process
// messages if we use wxExecute() or timers or ...)
// process the Windows messages that result from these functions
// (note that even in console applications we might have to process
// messages if we use wxExecute() or timers or ...)
- DWORD result = 0; // suppress warnings from broken compilers
+ DWORD result wxDUMMY_INITIALIZE(0);
do
{
if ( wxThread::IsMain() )
do
{
if ( wxThread::IsMain() )
long style,
const wxString& name)
{
long style,
const wxString& name)
{
+ bool ret wxDUMMY_INITIALIZE(false);
// init our fields
Init();
// init our fields
Init();
- bOK = ::ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE | EWX_REBOOT, 0) != 0;
+ bOK = ::ExitWindowsEx(flags, 0) != 0;
const wxString& ddeTopic,
const wxString& ddeCommand)
{
const wxString& ddeTopic,
const wxString& ddeCommand)
{
+ bool ok wxDUMMY_INITIALIZE(false);
wxDDEClient client;
wxConnectionBase *conn = client.MakeConnection(wxEmptyString,
wxDDEClient client;
wxConnectionBase *conn = client.MakeConnection(wxEmptyString,
TCHAR* buf = new TCHAR[chars+1];
// Get the list of drives.
TCHAR* buf = new TCHAR[chars+1];
// Get the list of drives.
- chars = GetLogicalDriveStrings(chars, buf);
+ GetLogicalDriveStrings(chars, buf);
// Parse the list into an array, applying appropriate filters.
TCHAR *pVol;
// Parse the list into an array, applying appropriate filters.
TCHAR *pVol;
int wxCharCodeWXToMSW(int id, bool *isVirtual)
{
*isVirtual = TRUE;
int wxCharCodeWXToMSW(int id, bool *isVirtual)
{
*isVirtual = TRUE;
switch (id)
{
case WXK_CANCEL: keySym = VK_CANCEL; break;
switch (id)
{
case WXK_CANCEL: keySym = VK_CANCEL; break;
lines = 5;
else if ( lines > 10 )
lines = 10;
lines = 5;
else if ( lines > 10 )
lines = 10;
DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_HELP,
(specialButton == wxTOPLEVEL_BUTTON_HELP) ?
specialButtonFlags : 0);
DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_HELP,
(specialButton == wxTOPLEVEL_BUTTON_HELP) ?
specialButtonFlags : 0);
- x -= FRAME_BUTTON_WIDTH;
style &= ~(wxCAPTION | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxSYSTEM_MENU | wxRESIZE_BORDER | wxFRAME_TOOL_WINDOW |
wxTHICK_FRAME);
style &= ~(wxCAPTION | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxSYSTEM_MENU | wxRESIZE_BORDER | wxFRAME_TOOL_WINDOW |
wxTHICK_FRAME);
- style = wxSIMPLE_BORDER;
+ style |= wxSIMPLE_BORDER;
SetExtraStyle(exstyleOrig &
~(wxFRAME_EX_CONTEXTHELP | wxDIALOG_EX_CONTEXTHELP));
}
SetExtraStyle(exstyleOrig &
~(wxFRAME_EX_CONTEXTHELP | wxDIALOG_EX_CONTEXTHELP));
}