<li>UDP support in wxSocket
<li>wxPlot
<li>XML for resource files.
+<li>Built-in support for configuring key bindings
</ul>
<P>
<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>
//#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
#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
// ----------------------------------------------------------------------------
TestStringSub();
TestStringFormat();
TestStringFind();
- }
TestStringTokenizer();
+ }
#endif // TEST_STRINGS
#ifdef TEST_ARRAYS
TestExecute();
#endif // TEST_EXECUTE
+#ifdef TEST_FILECONF
+ TestFileConfRead();
+#endif // TEST_FILECONF
+
#ifdef TEST_LOG
wxString s;
for ( size_t n = 0; n < 8000; n++ )
frame->Show(TRUE);
frame->SetCursor(wxCursor(wxCURSOR_HAND));
- frame->GetPanel()->m_notebook->SetSelection(6);
+ //frame->GetPanel()->m_notebook->SetSelection(6);
SetTopWindow(frame);
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);
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:
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));