From ee6e1b1d9c31045c74b8bb9cea0e47c6899d8b5d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 17 Feb 2000 14:12:32 +0000 Subject: [PATCH] assorted files I forgot to commit before git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/html/roadmap.htm | 5 +-- samples/console/Makefile.in | 1 + samples/console/console.cpp | 72 ++++++++++++++++++++++++++++++++++- samples/controls/controls.cpp | 5 ++- src/msw/checklst.cpp | 16 ++++---- 5 files changed, 83 insertions(+), 16 deletions(-) diff --git a/docs/html/roadmap.htm b/docs/html/roadmap.htm index dd252a865a..a96c2b87c4 100644 --- a/docs/html/roadmap.htm +++ b/docs/html/roadmap.htm @@ -110,6 +110,7 @@ Release date: ?
  • UDP support in wxSocket
  • wxPlot
  • XML for resource files. +
  • Built-in support for configuring key bindings

    @@ -187,9 +188,7 @@ written generically in wxWindows.

    diff --git a/samples/console/Makefile.in b/samples/console/Makefile.in index 0595ae2c30..b8c57fb300 100644 --- a/samples/console/Makefile.in +++ b/samples/console/Makefile.in @@ -16,6 +16,7 @@ program_dir = samples/console PROGRAM=console OBJECTS=$(PROGRAM).o +DATAFILES=testdata.fc include ../../src/makeprog.env diff --git a/samples/console/console.cpp b/samples/console/console.cpp index d073cb5511..b589b8fd9e 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -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 +#include + +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++ ) diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 8fc5a7ca9f..76e0fdf31f 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -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: diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index 5747dc5e79..808a4b4f7f 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -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 ; - -#ifdef __WIN32__ -#ifndef __SC__ +#if defined(__WIN32__) && !defined(__SC__) + RECT rect; + rect.left = 0; + rect.top = 0; + rect.right = nCheckWidth; + rect.bottom = nCheckHeight; + DrawFrameControl(hdcMem, &rect, DFC_MENU, DFCS_MENUCHECK); -#endif #else // In WIN16, draw a cross HPEN blackPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0)); -- 2.45.2