git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@957
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
Synchronize drawing functions on all platforms, using Chris's
code to test them.
Synchronize drawing functions on all platforms, using Chris's
code to test them.
+Extend wxSystemSettings to get symbols for current nationality,
+e.g. ',' instead of '.' for decimal points.
+
LOW PRIORITY
------------
LOW PRIORITY
------------
}
controlItem->SetStringValues(stringList);
count ++;
}
controlItem->SetStringValues(stringList);
count ++;
+// This is now obsolete: it's in the window style.
// Check for wxSINGLE/wxMULTIPLE
wxExpr *mult = (wxExpr *) NULL;
// Check for wxSINGLE/wxMULTIPLE
wxExpr *mult = (wxExpr *) NULL;
controlItem->SetValue1(wxLB_SINGLE);
controlItem->SetValue1(wxLB_SINGLE);
if ((mult = expr->Nth(count)) && ((mult->Type() == PrologString)||(mult->Type() == PrologWord)))
{
if ((mult = expr->Nth(count)) && ((mult->Type() == PrologString)||(mult->Type() == PrologWord)))
{
wxString m(mult->StringValue());
wxString m(mult->StringValue());
+ if (m == "wxLB_MULTIPLE")
controlItem->SetValue1(wxLB_MULTIPLE);
controlItem->SetValue1(wxLB_MULTIPLE);
- else if (m == "wxEXTENDED")
+ else if (m == "wxLB_EXTENDED")
controlItem->SetValue1(wxLB_EXTENDED);
controlItem->SetValue1(wxLB_EXTENDED);
+*/
+ // Ignore the value
- if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
- {
- // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+ }
+ if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
+ {
+ // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
- if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
- controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
- }
- }
+ if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
+ controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+ }
}
}
else if (controlType == "wxChoice")
}
}
else if (controlType == "wxChoice")
+static bool wxIsNumeric(const wxString& val);
+
wxTextValidator::wxTextValidator(long style, wxString *val)
{
m_validatorStyle = style ;
wxTextValidator::wxTextValidator(long style, wxString *val)
{
m_validatorStyle = style ;
wxMessageBox(buf,_("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
return FALSE;
}
wxMessageBox(buf,_("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
return FALSE;
}
- if ( (m_validatorStyle & wxFILTER_NUMERIC) && !val.IsNumber())
+ if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val))
+
{
char buf[512];
sprintf(buf, _("%s should be numeric."), (const char *)val);
{
char buf[512];
sprintf(buf, _("%s should be numeric."), (const char *)val);
textCtrl->wxTextCtrl::OnChar(event);
}
textCtrl->wxTextCtrl::OnChar(event);
}
+static bool wxIsNumeric(const wxString& val)
+{
+ int i;
+ for ( i = 0; i < (int)val.Length(); i++)
+ {
+ if ((!isdigit(val[i])) && (val[i] != '.'))
+ return FALSE;
+ }
+ return TRUE;
+}
int noHorizSteps = 0;
int noVertSteps = 0;
int noHorizSteps = 0;
int noVertSteps = 0;
- if (m_totalGridWidth <= cw)
+ if (m_totalGridWidth + vertScrollBarWidth <= cw)
- if (m_totalGridHeight <= ch)
+ if (m_totalGridHeight + horizScrollBarHeight <= ch)
- if (m_totalGridWidth <= cw)
+ if (m_totalGridWidth + vertScrollBarWidth <= cw)
{
if ( m_hScrollBar )
m_hScrollBar->Show(FALSE);
{
if ( m_hScrollBar )
m_hScrollBar->Show(FALSE);
m_hScrollBar->Show(TRUE);
}
m_hScrollBar->Show(TRUE);
}
- if (m_totalGridHeight <= ch)
+ if (m_totalGridHeight + horizScrollBarHeight <= ch)
{
if ( m_vScrollBar )
m_vScrollBar->Show(FALSE);
{
if ( m_vScrollBar )
m_vScrollBar->Show(FALSE);
bool wxListCtrl::GetItem(wxListItem& info) const
{
LV_ITEM lvItem;
bool wxListCtrl::GetItem(wxListItem& info) const
{
LV_ITEM lvItem;
+#ifdef __MINGW32__
+ memset(&lvItem, 0, sizeof(lvItem));
+#else
ZeroMemory(&lvItem, sizeof(lvItem)); // must set all fields to 0
ZeroMemory(&lvItem, sizeof(lvItem)); // must set all fields to 0
lvItem.iItem = info.m_itemId;
lvItem.iItem = info.m_itemId;
int width = size.x;
int height = size.y;
int width = size.x;
int height = size.y;
+ // To be consistent with wxGTK
+ if (width == -1)
+ width = 20;
+ if (height == -1)
+ height = 20;
+
wxSystemSettings settings;
m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_WINDOW) ; ;
wxSystemSettings settings;
m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_WINDOW) ; ;
if ((panelResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) != 0)
{
if ((panelResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) != 0)
{
- wxPoint pt = panel->ConvertPixelsToDialog(pt);
+ wxPoint pt = panel->ConvertPixelsToDialog(wxPoint(x, y));
res->SetSize(pt.x, pt.y, -1, -1);
}
else res->SetSize(x, y, -1, -1);
res->SetSize(pt.x, pt.y, -1, -1);
}
else res->SetSize(x, y, -1, -1);
if (!newItem)
return FALSE;
if (!newItem)
return FALSE;
+ int actualW, actualH;
+ newItem->GetSize(&actualW, &actualH);
+ wxSize actualSize(actualW, actualH);
+
+ if ((panelResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) != 0)
+ {
+ actualSize = panel->ConvertPixelsToDialog(actualSize);
+ }
+ res->SetSize(res->GetX(), res->GetY(), actualSize.x, actualSize.y);
+
wxString newIdName;
int id = GenerateWindowId(prefix, newIdName);
res->SetId(id);
wxString newIdName;
int id = GenerateWindowId(prefix, newIdName);
res->SetId(id);
wxWindow *parent = win->GetParent();
wxItemResource* parentResource = NULL;
if (parent)
wxWindow *parent = win->GetParent();
wxItemResource* parentResource = NULL;
if (parent)
- FindResourceForWindow(parent);
+ parentResource = FindResourceForWindow(parent);
if (win->IsKindOf(CLASSINFO(wxPanel)))
{
if (win->IsKindOf(CLASSINFO(wxPanel)))
{
+ stream << "]";
+/* Styles are now in the window style, not in a separate arg
+ stream << ", ";
switch (item->GetValue1())
{
case wxLB_MULTIPLE:
switch (item->GetValue1())
{
case wxLB_MULTIPLE:
if (item->GetFont().Ok())
{
stream << ",\\\n ";
if (item->GetFont().Ok())
{
stream << ",\\\n ";
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(listBox);
if (!resource)
return NULL;
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(listBox);
if (!resource)
return NULL;
+
+ char *mult = "wxLB_SINGLE";
- char *mult = "wxSINGLE";
-
- switch (resource->GetValue1())
- {
- case wxLB_MULTIPLE:
+ if ((listBox->GetWindowStyleFlag() & wxLB_MULTIPLE) != 0)
- break;
- case wxLB_EXTENDED:
+ else if ((listBox->GetWindowStyleFlag() & wxLB_EXTENDED) != 0)
- break;
- default:
- case wxLB_SINGLE:
return new wxProperty("multiple", mult, "string",
new wxStringListValidator(new wxStringList("wxLB_SINGLE", "wxLB_MULTIPLE", "wxLB_EXTENDED",
NULL)));
return new wxProperty("multiple", mult, "string",
new wxStringListValidator(new wxStringList("wxLB_SINGLE", "wxLB_MULTIPLE", "wxLB_EXTENDED",
NULL)));
}
else if (name == "multiple")
{
}
else if (name == "multiple")
{
- int mult = wxLB_SINGLE;
+ SetWindowStyle(m_propertyWindow, wxLB_SINGLE, FALSE);
+ SetWindowStyle(m_propertyWindow, wxLB_MULTIPLE, FALSE);
+ SetWindowStyle(m_propertyWindow, wxLB_EXTENDED, FALSE);
+
wxString str(property->GetValue().StringValue());
if (str == "wxLB_MULTIPLE")
wxString str(property->GetValue().StringValue());
if (str == "wxLB_MULTIPLE")
+ SetWindowStyle(m_propertyWindow, wxLB_MULTIPLE, TRUE);
else if (str == "wxLB_EXTENDED")
else if (str == "wxLB_EXTENDED")
+ SetWindowStyle(m_propertyWindow, wxLB_EXTENDED, TRUE);
+ SetWindowStyle(m_propertyWindow, wxLB_SINGLE, TRUE);
+
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(listBox);
if (resource)
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(listBox);
if (resource)
- resource->SetValue1(mult);
+ resource->SetStyle(m_propertyWindow->GetWindowStyleFlag());
wxResourceManager::GetCurrentResourceManager()->RecreateWindowFromResource(listBox, this);
return TRUE;
}
wxResourceManager::GetCurrentResourceManager()->RecreateWindowFromResource(listBox, this);
return TRUE;
}