assorted files I forgot to commit before

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2000-02-17 14:12:32 +00:00
parent 508011ce6c
commit ee6e1b1d9c
5 changed files with 82 additions and 15 deletions

View File

@ -110,6 +110,7 @@ Release date: ?
<li>UDP support in wxSocket
<li>wxPlot
<li>XML for resource files.
<li>Built-in support for configuring key bindings
</ul>
<P>
@ -187,9 +188,7 @@ written generically in wxWindows.
<ul>
<li>Windows CE port.
<li>Cure bug whereby in a panel within another panel, all buttons become
default buttons (heavy black border).
<li>Write a RC->WXR converter.
<li>Write a RC to WXR converter.
</ul>
<P>

View File

@ -16,6 +16,7 @@ program_dir = samples/console
PROGRAM=console
OBJECTS=$(PROGRAM).o
DATAFILES=testdata.fc
include ../../src/makeprog.env

View File

@ -33,10 +33,11 @@
//#define TEST_CMDLINE
//#define TEST_DIR
//#define TEST_EXECUTE
#define TEST_FILECONF
//#define TEST_LOG
//#define TEST_LONGLONG
//#define TEST_MIME
#define TEST_STRINGS
//#define TEST_STRINGS
//#define TEST_THREADS
//#define TEST_TIME
@ -189,6 +190,69 @@ static void TestExecute()
#endif // TEST_EXECUTE
// ----------------------------------------------------------------------------
// wxFileConfig
// ----------------------------------------------------------------------------
#ifdef TEST_FILECONF
#include <wx/confbase.h>
#include <wx/fileconf.h>
static const struct FileConfTestData
{
const wxChar *name; // value name
const wxChar *value; // the value from the file
} fcTestData[] =
{
{ _T("value1"), _T("one") },
{ _T("value2"), _T("two") },
{ _T("novalue"), _T("default") },
};
static void TestFileConfRead()
{
puts("*** testing wxFileConfig loading/reading ***");
wxFileConfig fileconf(_T("test"), wxEmptyString,
_T("testdata.fc"), wxEmptyString,
wxCONFIG_USE_RELATIVE_PATH);
// test simple reading
puts("\nReading config file:");
wxString defValue(_T("default")), value;
for ( size_t n = 0; n < WXSIZEOF(fcTestData); n++ )
{
const FileConfTestData& data = fcTestData[n];
value = fileconf.Read(data.name, defValue);
printf("\t%s = %s ", data.name, value.c_str());
if ( value == data.value )
{
puts("(ok)");
}
else
{
printf("(ERROR: should be %s)\n", data.value);
}
}
// test enumerating the entries
puts("\nEnumerating all root entries:");
long dummy;
wxString name;
bool cont = fileconf.GetFirstEntry(name, dummy);
while ( cont )
{
printf("\t%s = %s\n",
name.c_str(),
fileconf.Read(name.c_str(), _T("ERROR")).c_str());
cont = fileconf.GetNextEntry(name, dummy);
}
}
#endif // TEST_FILECONF
// ----------------------------------------------------------------------------
// MIME types
// ----------------------------------------------------------------------------
@ -2048,8 +2112,8 @@ int main(int argc, char **argv)
TestStringSub();
TestStringFormat();
TestStringFind();
}
TestStringTokenizer();
}
#endif // TEST_STRINGS
#ifdef TEST_ARRAYS
@ -2092,6 +2156,10 @@ int main(int argc, char **argv)
TestExecute();
#endif // TEST_EXECUTE
#ifdef TEST_FILECONF
TestFileConfRead();
#endif // TEST_FILECONF
#ifdef TEST_LOG
wxString s;
for ( size_t n = 0; n < 8000; n++ )

View File

@ -265,7 +265,7 @@ bool MyApp::OnInit()
frame->Show(TRUE);
frame->SetCursor(wxCursor(wxCURSOR_HAND));
frame->GetPanel()->m_notebook->SetSelection(6);
//frame->GetPanel()->m_notebook->SetSelection(6);
SetTopWindow(frame);
@ -395,7 +395,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
wxPoint(0, 250), wxSize(100, 50), wxTE_MULTILINE);
m_text->SetBackgroundColour("wheat");
wxLog::AddTraceMask(_T("focus"));
// wxLog::AddTraceMask(_T("focus"));
m_logTargetOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_text));
m_notebook = new wxNotebook(this, ID_NOTEBOOK);
@ -832,6 +832,7 @@ void MyPanel::OnListBoxButtons( wxCommandEvent &event )
m_lbSelectThis->Enable( event.GetInt() == 0 );
m_lbSelectNum->Enable( event.GetInt() == 0 );
m_listboxSorted->Enable( event.GetInt() == 0 );
FindWindow(ID_CHANGE_COLOUR)->Enable( event.GetInt() == 0 );
break;
}
case ID_LISTBOX_SEL_NUM:

View File

@ -144,16 +144,14 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
HBITMAP hbmpOld = (HBITMAP)SelectObject(hdcMem, hbmpCheck);
// then draw a check mark into it
RECT rect ;
rect.left = 0 ;
rect.top = 0 ;
rect.right = nCheckWidth ;
rect.bottom = nCheckHeight ;
#if defined(__WIN32__) && !defined(__SC__)
RECT rect;
rect.left = 0;
rect.top = 0;
rect.right = nCheckWidth;
rect.bottom = nCheckHeight;
#ifdef __WIN32__
#ifndef __SC__
DrawFrameControl(hdcMem, &rect, DFC_MENU, DFCS_MENUCHECK);
#endif
#else
// In WIN16, draw a cross
HPEN blackPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0));