#include <math.h>
#include <string.h>
-#if defined(__WINDOWS__) && !defined(__GNUWIN32__)
+#if defined(__WXMSW__) && !defined(__GNUWIN32__)
#include <strstrea.h>
#else
#include <strstream.h>
#include "reseditr.h"
#include "winprop.h"
-#include "editrpal.h"
#include "dlghndlr.h"
#include "edlist.h"
resourceManager->RemoveSelection(item);
}
-void wxResourceEditorDialogHandler::OnPaint(wxPaintEvent& event)
+void wxResourceEditorDialogHandler::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc(handlerDialog);
case RESED_CHOICE:
resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxChoice", x, y);
break;
+ case RESED_COMBOBOX:
+ resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxComboBox", x, y);
+ break;
case RESED_CHECKBOX:
resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxCheckBox", x, y);
break;
case RESED_RADIOBOX:
resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxRadioBox", x, y);
break;
+ case RESED_RADIOBUTTON:
+ resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxRadioButton", x, y);
+ break;
case RESED_LISTBOX:
resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxListBox", x, y);
break;
}
}
-#if 0
-void wxResourceEditorDialogHandler::OnLeftClick(int x, int y, int keys)
-{
- if (keys & wxKEY_CTRL)
- {
- wxResourceManager::GetCurrentResourceManager()->EditWindow(handlerDialog);
- return;
- }
-
- // Deselect all items if click on panel
- if (resourceManager->GetEditorPalette()->currentlySelected == PALETTE_ARROW)
- {
- int needsRefresh = 0;
- wxNode *node = handlerDialog->GetChildren()->First();
- while (node)
- {
- wxControl *item = (wxControl *)node->Data();
- wxResourceEditorControlHandler *childHandler = (wxResourceEditorControlHandler *)item->GetEventHandler();
- if (item->IsKindOf(CLASSINFO(wxControl)) && childHandler->IsSelected())
- {
- needsRefresh ++;
- OnItemSelect(item, FALSE);
- childHandler->SelectItem(FALSE);
- }
- node = node->Next();
- }
- if (needsRefresh > 0)
- {
- wxClientDC dc(handlerDialog);
- dc.Clear();
- handlerDialog->Refresh();
- }
- return;
- }
-
- wxResourceManager* manager = resourceManager;
-
- switch (resourceManager->GetEditorPalette()->currentlySelected)
- {
- case PALETTE_FRAME:
- break;
- case PALETTE_DIALOG_BOX:
- break;
- case PALETTE_PANEL:
- break;
- case PALETTE_CANVAS:
- break;
- case PALETTE_TEXT_WINDOW:
- break;
- case PALETTE_BUTTON:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxButton", x, y);
- break;
- case PALETTE_BITMAP_BUTTON:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxButton", x, y, TRUE);
- break;
- case PALETTE_MESSAGE:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxStaticText", x, y);
- break;
- case PALETTE_BITMAP_MESSAGE:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxStaticBitmap", x, y, TRUE);
- break;
- case PALETTE_TEXT:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxTextCtrl (single-line)", x, y);
- break;
- case PALETTE_MULTITEXT:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxTextCtrl (multi-line)", x, y);
- break;
- case PALETTE_CHOICE:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxChoice", x, y);
- break;
- case PALETTE_CHECKBOX:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxCheckBox", x, y);
- break;
- case PALETTE_RADIOBOX:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxRadioBox", x, y);
- break;
- case PALETTE_LISTBOX:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxListBox", x, y);
- break;
- case PALETTE_SLIDER:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxSlider", x, y);
- break;
- case PALETTE_GAUGE:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxGauge", x, y);
- break;
- case PALETTE_GROUPBOX:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxStaticBox", x, y);
- break;
- case PALETTE_SCROLLBAR:
- resourceManager->CreatePanelItem(handlerResource, handlerDialog, "wxScrollBar", x, y);
- break;
- default:
- break;
- }
-
- // Now switch pointer on.
- if (manager->GetEditorPalette()->currentlySelected != PALETTE_ARROW)
- {
- manager->GetEditorPalette()->ToggleTool(manager->GetEditorPalette()->currentlySelected, FALSE);
- manager->GetEditorPalette()->ToggleTool(PALETTE_ARROW, TRUE);
- manager->GetEditorPalette()->currentlySelected = PALETTE_ARROW;
- }
-}
-#endif
-
-void wxResourceEditorDialogHandler::OnRightClick(int x, int y, int keys)
+void wxResourceEditorDialogHandler::OnRightClick(int x, int y, int WXUNUSED(keys))
{
wxMenu *menu = resourceManager->GetPopupMenu();
menu->SetClientData((char *)handlerDialog);
wxResourceManager::GetCurrentResourceManager()->EditWindow(item);
return;
}
-
+
+/*
// If this is a wxStaticBox and the pointer isn't an arrow, chances
// are that we really meant to place an item on the panel.
// Fake this event.
OnLeftClick(x, y, keys);
return;
}
+*/
wxResourceEditorControlHandler *childHandler = (wxResourceEditorControlHandler *)item->GetEventHandler();
}
}
-void wxResourceEditorDialogHandler::OnItemRightClick(wxControl *item, int x, int y, int keys)
+void wxResourceEditorDialogHandler::OnItemRightClick(wxControl *item, int x, int y, int WXUNUSED(keys))
{
/*
if (keys & wxKEY_CTRL)