]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/dialoged/src/dlghndlr.cpp
fixed a logical error (! isempty) instead of isempty
[wxWidgets.git] / utils / dialoged / src / dlghndlr.cpp
index f27188ac945dfea77661d001e34158299dfb43ee..aad48c3e3b6b492edee3c57842d2e8c2f388dc34 100644 (file)
@@ -29,7 +29,7 @@
 #include <math.h>
 #include <string.h>
 
-#if defined(__WINDOWS__) && !defined(__GNUWIN32__)
+#if defined(__WXMSW__) && !defined(__GNUWIN32__)
 #include <strstrea.h>
 #else
 #include <strstream.h>
@@ -37,7 +37,6 @@
 
 #include "reseditr.h"
 #include "winprop.h"
-#include "editrpal.h"
 #include "dlghndlr.h"
 #include "edlist.h"
 
@@ -90,7 +89,7 @@ void wxResourceEditorDialogHandler::OnItemSelect(wxControl *item, bool select)
     resourceManager->RemoveSelection(item);
 }
 
-void wxResourceEditorDialogHandler::OnPaint(wxPaintEvent& event)
+void wxResourceEditorDialogHandler::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
        wxPaintDC dc(handlerDialog);
 
@@ -170,12 +169,18 @@ void wxResourceEditorDialogHandler::OnLeftClick(int x, int y, int keys)
         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;
@@ -202,112 +207,7 @@ void wxResourceEditorDialogHandler::OnLeftClick(int x, int y, int keys)
   }
 }
 
-#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);
@@ -321,7 +221,8 @@ void wxResourceEditorDialogHandler::OnItemLeftClick(wxControl *item, int x, int
     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.
@@ -330,6 +231,7 @@ void wxResourceEditorDialogHandler::OnItemLeftClick(wxControl *item, int x, int
     OnLeftClick(x,  y, keys);
     return;
   }
+*/
   
   wxResourceEditorControlHandler *childHandler = (wxResourceEditorControlHandler *)item->GetEventHandler();
 
@@ -377,7 +279,7 @@ void wxResourceEditorDialogHandler::OnItemLeftClick(wxControl *item, int x, int
   }
 }
 
-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)