[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : alex
Repository : xara
Revision : 1702
Date : Wed Aug 16 16:21:13 BST 2006
Changed paths:
M /Trunk/XaraLX/Kernel/biasdlg.cpp
M /Trunk/XaraLX/Kernel/biasdlg.h
M /Trunk/XaraLX/tools/filltool.cpp
M /Trunk/XaraLX/tools/filltool.h
M /Trunk/XaraLX/tools/freeinfo.cpp
M /Trunk/XaraLX/tools/freeinfo.h
M /Trunk/XaraLX/wxOil/Makefile.am
M /Trunk/XaraLX/wxOil/camresource.cpp
M /Trunk/XaraLX/wxOil/dlgevt.cpp
M /Trunk/XaraLX/wxOil/dlgmgr.cpp
M /Trunk/XaraLX/wxOil/xrc/EN/biasres.xrc
M /Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc
M /Trunk/XaraLX/wxXtra/Makefile.am
M /Trunk/XaraLX/wxXtra/wxXtra.h
Apply Mikhail T's patches for bitmap dropdowns
Diff:
Index: Trunk/XaraLX/tools/filltool.h
===================================================================
--- Trunk/XaraLX/tools/filltool.h (revision 1701)
+++ Trunk/XaraLX/tools/filltool.h (revision 1702)
@@ -107,6 +107,7 @@
#include "fillattr.h"
#include "lineattr.h"
#include "biasgdgt.h"
+#include "bitmapgriddropdown.h"
//#include "selop.h"
#include "brshattr.h"
#include "list.h"
@@ -538,7 +539,8 @@
INT32 SliderMax;
public:
- CBiasGainGadget m_BiasGainGadget; // Gadget for invoking bias gain dialog
+ CBiasGainGadget m_BiasGainGadget; // Gadget for invoking bias gain dialog
+ CBitmapGridDropDown m_oBitmapDropDown; // bitmap selector combobox.
};
@@ -689,7 +691,8 @@
AttrValueChange* m_pDragTransp;
public:
- CBiasGainGadget m_BiasGainGadget; // Gadget for invoking the bias gain dialog.
+ CBiasGainGadget m_BiasGainGadget; // Gadget for invoking the bias gain dialog.
+ CBitmapGridDropDown m_oBitmapDropDown; // bitmap selector combobox.
};
/********************************************************************************************
Index: Trunk/XaraLX/tools/freeinfo.h
===================================================================
--- Trunk/XaraLX/tools/freeinfo.h (revision 1701)
+++ Trunk/XaraLX/tools/freeinfo.h (revision 1702)
@@ -107,6 +107,7 @@
#include "brshgdgt.h"
#include "brshcomp.h" // for brushhandle
#include "valfunc.h" // for valuefunctionID
+#include "bitmapgriddropdown.h"
#include <list>
@@ -139,7 +140,6 @@
void SetRetroState(BOOL CanRetroFit);
void SetRetroString();
- void InitBrushes ();
void AddBrush();
void AddBrush(BrushHandle Handle);
@@ -205,6 +205,9 @@
BrushHandle m_DisplayBrush; // the currently displayed brush in the combo
+ CBitmapGridDropDown m_bgddBrushType;
+ CBitmapGridDropDown m_bgddStrokes;
+
PORTNOTE("other", "Disabled Brush editing")
#ifndef EXCLUDE_FROM_XARALX
static CBrushGadget BrushGadget; // we only ever want one version of the brush edit dialog
Index: Trunk/XaraLX/tools/freeinfo.cpp
===================================================================
--- Trunk/XaraLX/tools/freeinfo.cpp (revision 1701)
+++ Trunk/XaraLX/tools/freeinfo.cpp (revision 1702)
@@ -560,339 +560,8 @@
return (InformationBarOp::Message(Message));
}
-// NO LONGER USED!! Scheduled for demolition in five of your earth minutes, what do you mean
-// you've never been to alpha centauri??
-void FreeHandInfoBarOp::InitBrushes ()
-{
- // first get our brush list
- if (InitBrushList() == FALSE)
- {
- ToolInformError(_R(IDS_OUT_OF_MEMORY), _R(IDS_OK));
- return;
- }
- // if we have no document then don't bother
- Document* pDoc = Document::GetCurrent();
- if (pDoc != NULL)
- {
-//#ifdef BUILDNEWBRUSHES
- DeleteAllValues(_R(IDC_BRUSHTYPE));
-
- // find out how many brushes there are
- UINT32 NumBrushes = BrushComponent::GetNumberOfBrushes ();
- for (UINT32 Index = 1; Index <= NumBrushes; Index++)
- {
- // ask the component to make a node for us
-
- AttrBrushType* pNewAttr = BrushComponent::CreateNode ((BrushHandle) Index-1);
-
- if (pNewAttr == NULL)
- {
- ToolInformError(_R(IDS_OUT_OF_MEMORY), _R(IDS_OK));
- return;
- }
-PORTNOTE("other", "Removed CustomComboBoxControlDataItem");
-#ifndef EXCLUDE_FROM_XARALX
- CustomComboBoxControlDataItem * theItem = new CustomComboBoxControlDataItem ();
- if (theItem == NULL)
- {
- ToolInformError(_R(IDS_OUT_OF_MEMORY), _R(IDS_OK));
- return;
- }
-
- theItem->itemID = Index;
-
- // make the custom combobox know about our brush ....
- theItem->itemBrush = (AttrBrushType*) pNewAttr;
-
- // and insert the data item into the cutsom combobox ....
- SetCustomComboGadgetValue ( _R(IDC_BRUSHTYPE), theItem, TRUE, 0);
-#endif
-
- }
-//#else
-/*
- UINT32 index = 1;
- CustomComboBoxControlDataItem* theItem = NULL;
-
- // --- Simple constant-width line ------------------------------------------
- VariableWidthAttrValue *pAttr;
- pAttr = new VariableWidthAttrValue(NULL);
- VarWidthItem* pItem = new VarWidthItem(pAttr, String_64(TEXT("Constant")));
- //NodeAttributepItem->CreateNewAttribute ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Constant";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Blip ----------------------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionBlip);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Blip")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Blip";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Ellipse -------------------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionEllipse);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Ellipse")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Ellipse";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Simple linear ramp --------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionRampL);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Concave 3")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Concave 3";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Simple linear ramp with non-zero end width --------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionRampL2);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Concave 2")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Concave 2";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Simple S-shaped ramp ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionRampS);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Convex 3")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Convex 3";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Simple S-shaped ramp with non-zero end width ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionRampS2);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Convex 2")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Convex 2";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Teardrop ------------------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionTeardrop);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Raindrop")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Raindrop";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- TeardropCurvedEnd ------------------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionTeardropCurvedEnd);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Dab")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Dab";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Double S-shaped ramp ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionDoubleRampS);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Bow Tie")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Bow Tie";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Propeller ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionPropeller);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Propeller")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Propeller";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- BevelEnds ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionBevelEnds);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Bevel Ends")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Bevel Ends";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Intestine ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionIntestine);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Intestine")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Intestine";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- SawTooth ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSawTooth);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Saw Tooth")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Saw Tooth";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Decay ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionDecay);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Decay")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Decay";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Reed ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Reed);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Reed")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Reed";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Meteor ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Meteor);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Meteor")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Meteor";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Petal ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Petal);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Petal")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Petal";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Comet ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Comet);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Comet")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Comet";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Barb ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Barb);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Barb")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Barb";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Concave ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Concave);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Concave")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Concave";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Convex ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Convex);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Convex")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Convex";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Iron ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Iron);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Iron")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Iron";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Torpedo ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Torpedo);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Torpedo")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Torpedo";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Missile ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Missile);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Missile")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Missile";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Goldfish ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Goldfish);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Goldfish")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Goldfish";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_OceanLiner ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_OceanLiner);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("OceanLiner")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "OceanLiner";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Yacht ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Yacht);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Yacht")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Yacht";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Cigar ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Cigar);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Cigar")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Cigar";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-
- // --- Smooth Stroke SS_Fallout ------------------------------------------------
- pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Fallout);
- pItem = new VarWidthItem(pAttr, String_64(TEXT("Fallout")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Fallout";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
-*/
-//#endif
- }
-}
-
-
/********************************************************************************************
> void FreeHandInfoBarOp::AddBrush ()
@@ -1006,7 +675,6 @@
Purpose: Called when a DIM_CREATE message is received
********************************************************************************************/
-
void FreeHandInfoBarOp::HandleCreate()
{
if (WindowID!=NULL)
@@ -1041,6 +709,16 @@
if (m_pBrushList == NULL || m_pBrushList->size() == 0)
InitBrushList();
+ // Create the brush type combobox.
+ m_bgddBrushType.Init(WindowID, _R(IDC_BRUSHTYPE));
+ m_bgddBrushType.SetColumns(3);
+ m_bgddBrushType.SetItemSize(wxSize(50, 50));
+
+ // Create the stroke type combobox.
+ m_bgddStrokes.Init(WindowID, _R(IDC_STROKETYPE));
+ m_bgddStrokes.SetColumns(3);
+ m_bgddStrokes.SetItemSize(wxSize(50, 50));
+
// create our brush list objects and put them in the control
SetBrushListToControl();
@@ -1085,18 +763,15 @@
return;
// Someone selected a new brush
- WORD Index;
+ INT32 iIndex = m_bgddBrushType.GetSelected();
- // find out which index they selected
- GetValueIndex (_R(IDC_BRUSHTYPE), &Index);
-
BrushHandle SelHandle;
// the zeroth index is always reserved for the 'no-brush'
- if (Index == 0)
+ if (iIndex == 0)
SelHandle = BrushHandle_NoBrush;
else
- SelHandle = GetBrushHandleFromControlIndex(Index-1);
+ SelHandle = GetBrushHandleFromControlIndex(iIndex-1);
//TRACEUSER( "Diccon", _T("Brush Combo: Handle = %d, Index = %d
"), SelHandle, Index);
// tell the tool our selection has changed
@@ -1145,10 +820,8 @@
return;
// Someone selected a new brush
- WORD Index;
+ int Index = m_bgddStrokes.GetSelected();
- // find out which index they selected
- GetValueIndex (_R(IDC_STROKETYPE), &Index);
// what we are going to do is apply a stroke attribute and a variable width attribute at the
// same time via the attribute manager. This will require making a list
@@ -1177,7 +850,7 @@
// now make a pathprocessor and a stroke attribute, note that if we apply a CONSTANT stroke we don't need to
PathProcessorStroke* PPS = NULL;
- if (Index-1 != CONSTANT)
+ if (Index != CONSTANT)
{
PPS = new PathProcessorStroke;
if (PPS == NULL)
@@ -1204,7 +877,7 @@
pStrokeItem->NodeAttribPtr = pStrokeType;
- switch (Index-1)
+ switch (Index)
{
case CONSTANT:
{
@@ -1861,7 +1534,7 @@
{
// recall that the indexes in the control are 1 greater than our enum constants
if (pSel->IsEmpty())
- m_SelectedStroke = Index - 1;
+ m_SelectedStroke = Index;
// update the selection bounds
pSel->UpdateParentBoundsOfSelection();
@@ -2182,7 +1855,8 @@
return TRUE;
// wipe our existing control
- DeleteAllValues(_R(IDC_BRUSHTYPE));
+// DeleteAllValues(_R(IDC_BRUSHTYPE));
+ m_bgddBrushType.Clear();
// need a pointer of type CustomComboBoxControlDataItem to insert items into
// a custom combobox ....
@@ -2204,35 +1878,13 @@
AttrBrushType* pNewAttr = BrushComponent::CreateNode (Handle);
if (pNewAttr != NULL)
- {
-PORTNOTE("other", "Removed CustomComboCoxControlDataItem");
-#ifndef EXCLUDE_FROM_XARALX
- // make a new data item
- theItem = new CustomComboBoxControlDataItem ();
- if (theItem == NULL)
- {
- ToolInformError(_R(IDS_OUT_OF_MEMORY), _R(IDS_OK));
- return FALSE;
- }
-
- theItem->itemID = Counter++;
-
- // make the custom combobox know about our brush ....
- theItem->itemBrush = (AttrBrushType*) pNewAttr;
-
- // and insert the data item into the cutsom combobox ....
- SetCustomComboGadgetValue ( _R(IDC_BRUSHTYPE), theItem, TRUE, 0);
-
- theItem = NULL;
-#endif
- }
+ m_bgddBrushType.AddItem(pNewAttr);
}
else
{
ERROR3("Default brush handle found in list in FreeHandInfoBarOp::SetBrushListToControl");
}
}
-//#else
return SetStrokesToControl() ;
}
@@ -2250,377 +1902,185 @@
BOOL FreeHandInfoBarOp::SetStrokesToControl()
{
- DeleteAllValues(_R(IDC_STROKETYPE));
+// DeleteAllValues(_R(IDC_STROKETYPE));
+ m_bgddStrokes.Clear();
-PORTNOTE("other", "Removed CustomComboBoxControlDataItem")
-#ifndef EXCLUDE_FROM_XARALX
- UINT32 index = 1;
-
- CustomComboBoxControlDataItem* theItem = NULL;
+// UINT32 index = 1;
+// CustomComboBoxControlDataItem* theItem = NULL;
// --- Simple constant-width line ------------------------------------------
VariableWidthAttrValue *pAttr;
pAttr = new VariableWidthAttrValue(NULL);
VarWidthItem* pItem = new VarWidthItem(pAttr, String_64(TEXT("Constant")));
- //NodeAttribute* pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Constant"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Fallout ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Fallout);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Fallout")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Fallout";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Iron ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Iron);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Iron")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Iron";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Ellipse -------------------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionEllipse);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Ellipse")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Ellipse"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_SlimBlip ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_SlimBlip);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Slim Blip")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Slim Blip";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Blip ----------------------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionBlip);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Blip")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Blip"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Cigar ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Cigar);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Cigar")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Cigar";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Cigar2 ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Cigar2);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Cigar 2")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Cigar 2";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Cigar3 ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Cigar3);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Cigar 3")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Cigar 3";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Convex ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Convex);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Convex")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Convex";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Simple S-shaped ramp with non-zero end width ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionRampS2);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Convex 2")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Convex 2"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Simple S-shaped ramp ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionRampS);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Convex 3")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Convex 3"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Concave ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Concave);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Concave")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Concave";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Simple linear ramp with non-zero end width --------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionRampL2);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Concave 2")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Concave 2"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Simple linear ramp --------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionRampL);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Concave 3")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Concave 3"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Teardrop CurvedEnd------------------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionTeardropCurvedEnd);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Dab")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Dab"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Teardrop ------------------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionTeardrop);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Raindrop")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Raindrop"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Comet ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Comet);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Comet")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Comet";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Petal ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Petal);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Petal")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Petal";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Reed ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Reed);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Reed")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Reed";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Meteor ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Meteor);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Meteor")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Meteor";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Torpedo ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Torpedo);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Torpedo")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Torpedo";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Missile ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Missile);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Missile")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Missile";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Goldfish ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Goldfish);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Goldfish")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Goldfish";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Yacht ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Yacht);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Yacht")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Yacht";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_Barb ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_Barb);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Barb")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Barb";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Smooth Stroke SS_OceanLiner ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSS_OceanLiner);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Ocean Liner")));
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = "Ocean Liner";
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Propeller ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionPropeller);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Propeller")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Propeller"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Double S-shaped ramp ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionDoubleRampS);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Bow Tie")));
//pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Bow Tie"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- BevelEnds ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionBevelEnds);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Bevel Ends")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Bevel Ends"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- SawTooth ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionSawTooth);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Saw Tooth")));
//pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Saw Tooth"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Intestine ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionIntestine);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Intestine")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Intestine"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
// --- Decay ------------------------------------------------
pAttr = new VariableWidthAttrValue(new ValueFunctionDecay);
pItem = new VarWidthItem(pAttr, String_64(TEXT("Decay")));
- //pAttr2 = (NodeAttribute*) pItem->CreateNode ();
- theItem = new CustomComboBoxControlDataItem ();
- theItem->itemID = index++;
- theItem->itemStroke = (VarWidthItem*) pItem;
- theItem->itemName = String_64(TEXT("Decay"));
- if (pAttr == NULL || pItem == NULL || theItem == NULL)
- goto ExitFalse;
- SetCustomComboGadgetValue ( _R(IDC_STROKETYPE), theItem, TRUE, 0);
+ m_bgddStrokes.AddItem(pItem);
SetStrokeComboFromSelection();
return TRUE;
-
-ExitFalse: // clean up anything we managed to allocate
- if (pAttr)
- delete pAttr;
- if (pItem)
- delete pItem;
- if (theItem)
- delete theItem;
-
- return FALSE;
-
-#else
- return TRUE;
-#endif
-
}
@@ -2655,6 +2115,7 @@
BrushHandle Handle = m_pBrushList->front();
SetCustomComboGadgetValue(_R(IDC_BRUSHTYPE), NULL, 0, 2 );
+
m_DisplayBrush = Handle;
}
@@ -2890,18 +2351,23 @@
// if we have different strokes we need to say 'many', (what choo talkin' bout Willis!?)
if (bDifferent)
{
- // the only way to do this seems to be by sending a string to the control
+/* // the only way to do this seems to be by sending a string to the control
String_256 Many;
Many.Load(_R(IDS_FILLTOOL_MANY));
// call custom controls interface ....
SelectCustomComboGadgetValueOnString (_R(IDC_STROKETYPE), &Many);
+*/
+ // Select none in the stroke dropdown since we don't support placing "many" word
+ // into the combobox.
+ m_bgddStrokes.SetSelected(-1);
return;
}
}
+
// now set the index to the control
- SetCustomComboGadgetValue(_R(IDC_STROKETYPE), NULL, TRUE, SelectedStroke + 1);
+ m_bgddStrokes.SetSelected(SelectedStroke);
}
Index: Trunk/XaraLX/tools/filltool.cpp
===================================================================
--- Trunk/XaraLX/tools/filltool.cpp (revision 1701)
+++ Trunk/XaraLX/tools/filltool.cpp (revision 1702)
@@ -2788,16 +2788,17 @@
case DIM_SELECTION_CHANGED:
{
// Someone selected a new bitmap Fill Effect
- INT32 Index;
- GetValueIndex (_R(IDC_BITMAPEFFECT), &Index);
+ INT32 iIndex = m_oBitmapDropDown.GetSelected();
+ // GetValueIndex (_R(IDC_BITMAPEFFECT), &Index);
+
//if (CurrentEffectIndex != Index)
//{
// Change the bitmap Fill Effect Here
// (we use CurrentEffectIndex because of the days when
// _R(IDC_EFFECT) handled this as well; thus we avoid having
// to change all of the code that relates to this
- CurrentEffectIndex = Index;
+ CurrentEffectIndex = iIndex;
ChangeBitmapName ();
//}
}
@@ -3227,9 +3228,13 @@
DeleteAllValues(_R(IDC_GEOMETRY));
DeleteAllValues(_R(IDC_EFFECT));
- DeleteAllValues(_R(IDC_BITMAPEFFECT));
+// DeleteAllValues(_R(IDC_BITMAPEFFECT));
DeleteAllValues(_R(IDC_MAPPING));
+ m_oBitmapDropDown.Init(WindowID, _R(IDC_BITMAPEFFECT));
+ m_oBitmapDropDown.SetColumns(3);
+ m_oBitmapDropDown.SetItemSize(wxSize(50, 50));
+
String_64 Str;
// Setup the Menu Item text entries
@@ -3403,7 +3408,8 @@
void GradInfoBarOp::InitBitmapName()
{
- DeleteAllValues(_R(IDC_BITMAPEFFECT));
+// DeleteAllValues(_R(IDC_BITMAPEFFECT));
+ m_oBitmapDropDown.Clear();
EnableGadget (_R(IDC_BITMAPEFFECT), TRUE);
EffectDisabled = FALSE;
@@ -3425,7 +3431,6 @@
ListItem* pBmp = Bitmaps->GetHead();
- DeleteAllValues ( _R(IDC_BITMAPEFFECT) );
while (pBmp != NULL)
{
@@ -3433,37 +3438,16 @@
{
Str = ((KernelBitmap*)pBmp)->ActualBitmap->GetName();
-PORTNOTETRACE("other","GradInfoBarOp::InitBitmapName() - removed CustomComboBox handler");
-#ifndef EXCLUDE_FROM_XARALX
- CustomComboBoxControlDataItem* theItem = new CustomComboBoxControlDataItem ();
- theItem->itemName = Str;
- theItem->itemID = Index;
-
KernelBitmap* bitmap = ((KernelBitmap*)pBmp);
-
- // make the custom combobox know about our bitmap ....
- theItem->oilItemBitmap = (KernelBitmap*) bitmap;
-
- // and insert the data item into the cutsom combobox ....
- SetCustomComboGadgetValue( _R(IDC_BITMAPEFFECT), theItem, TRUE, 0);
-#else
- SetStringGadgetValue(_R(IDC_BITMAPEFFECT), Str, TRUE, Index);
-#endif
+ m_oBitmapDropDown.AddItem(bitmap, Str);
+
Index++;
}
pBmp = Bitmaps->GetNext(pBmp);
}
- SetComboListLength(_R(IDC_BITMAPEFFECT));
}
- //else
- //{
- // (not sure about this for a custom box)
-
- //Str.Load(_R(IDS_FILLTOOL_DEFAULTNAME));
- //SetStringGadgetValue(_R(IDC_EFFECT),&Str,TRUE, 0);
- //}
}
@@ -4142,16 +4126,8 @@
void GradInfoBarOp::ShowCommonBitmapName()
{
- String_64 Str;
-
- Str = FindCommonBitmapName();
- // call custom controls interface ....
-PORTNOTETRACE("other","GradInfoBarOp::InitBitmapName() - removed CustomComboBox handler");
-#ifndef EXCLUDE_FROM_XARALX
- SelectCustomComboGadgetValueOnString(_R(IDC_BITMAPEFFECT), &Str);
-#else
- SetGadgetString(_R(IDC_BITMAPEFFECT), &Str);
-#endif
+ String_64 strName = FindCommonBitmapName();
+ m_oBitmapDropDown.SelectByLabel(strName);
}
/********************************************************************************************
@@ -6046,8 +6022,7 @@
case DIM_SELECTION_CHANGED:
{
// Someone selected a new bitmap Fill Effect
- INT32 Index;
- GetValueIndex (_R(IDC_BITMAPEFFECT), &Index);
+ INT32 Index = m_oBitmapDropDown.GetSelected();
//if (CurrentBitmapIndex != Index)
//{
@@ -6631,8 +6606,12 @@
DeleteAllValues(_R(IDC_GEOMETRY));
DeleteAllValues(_R(IDC_TRANSPTYPE));
DeleteAllValues(_R(IDC_MAPPING));
- DeleteAllValues(_R(IDC_BITMAPEFFECT));
+// DeleteAllValues(_R(IDC_BITMAPEFFECT));
+ m_oBitmapDropDown.Init(WindowID, _R(IDC_BITMAPEFFECT));
+ m_oBitmapDropDown.SetColumns(3);
+ m_oBitmapDropDown.SetItemSize(wxSize(50, 50));
+
SetGadgetHelp(_R(IDC_GEOMETRY), _R(IDBBL_TRANSPTOOL_TRANSPSHAPE), _R(IDS_TRANSPTOOL_TRANSPSHAPE));
SetGadgetHelp(_R(IDC_TRANSPTYPE), _R(IDBBL_TRANSPTOOL_TRANSPTYPE), _R(IDS_TRANSPTOOL_TRANSPTYPE));
SetGadgetHelp(_R(IDC_MAPPING), _R(IDBBL_TRANSPTOOL_TRANSPTILING), _R(IDS_TRANSPTOOL_TRANSPTILING));
@@ -6820,7 +6799,8 @@
void TranspInfoBarOp::InitBitmapName()
{
- DeleteAllValues(_R(IDC_BITMAPEFFECT));
+// DeleteAllValues(_R(IDC_BITMAPEFFECT));
+ m_oBitmapDropDown.Clear();
EnableGadget (_R(IDC_BITMAPEFFECT), TRUE);
Document* pDoc = Document::GetSelected();
@@ -6840,7 +6820,7 @@
ListItem* pBmp = Bitmaps->GetHead();
- DeleteAllValues ( _R(IDC_BITMAPEFFECT) );
+// DeleteAllValues ( _R(IDC_BITMAPEFFECT) );
while (pBmp != NULL)
{
@@ -6848,29 +6828,16 @@
{
Str = ((KernelBitmap*)pBmp)->ActualBitmap->GetName();
-PORTNOTETRACE("other","SelectorTool::ResetDefaults - SelectorInfoBarOp usage");
-#ifndef EXCLUDE_FROM_XARALX
- CustomComboBoxControlDataItem* theItem = new CustomComboBoxControlDataItem ();
- theItem->itemName = Str;
- theItem->itemID = Index;
-
KernelBitmap* bitmap = ((KernelBitmap*)pBmp);
-
- // make the custom combobox know about our bitmap ....
- theItem->oilItemBitmap = (KernelBitmap*) bitmap;
-
- // and insert the data item into the cutsom combobox ....
- SetCustomComboGadgetValue ( _R(IDC_BITMAPEFFECT), theItem, TRUE, 0);
-#else
- SetStringGadgetValue(_R(IDC_BITMAPEFFECT), Str, TRUE, Index);
-#endif
+ m_oBitmapDropDown.AddItem(bitmap, Str);
+
Index++;
}
pBmp = Bitmaps->GetNext(pBmp);
}
- SetComboListLength(_R(IDC_BITMAPEFFECT));
+// SetComboListLength(_R(IDC_BITMAPEFFECT));
}
//else
//{
@@ -7800,15 +7767,8 @@
void TranspInfoBarOp::ShowCommonBitmapName()
{
- String_64 Str;
-
- Str = FindCommonBitmapName();
-PORTNOTETRACE("other","TranspInfoBarOp::InitBitmapName() - removed CustomComboBox handler");
-#ifndef EXCLUDE_FROM_XARALX
- SelectCustomComboGadgetValueOnString(_R(IDC_BITMAPEFFECT), &Str);
-#else
- SetGadgetString(_R(IDC_BITMAPEFFECT), &Str);
-#endif
+ String_64 strName = FindCommonBitmapName();
+ m_oBitmapDropDown.SelectByLabel(strName);
}
/********************************************************************************************
Index: Trunk/XaraLX/Kernel/biasdlg.cpp
===================================================================
--- Trunk/XaraLX/Kernel/biasdlg.cpp (revision 1701)
+++ Trunk/XaraLX/Kernel/biasdlg.cpp (revision 1702)
@@ -320,7 +320,7 @@
if (noProfile == TRUE)
{
// SetCustomComboGadgetValue ( _R(IDC_BIASGAINCOMBO), (CustomComboBoxControlDataItem*) NULL, TRUE, -1);
- m_pobddStandardProfile->SetSelectedIndex(-1);
+ m_pobddStandardProfile->SetSelected(-1);
// and disable all other controls ....
DisableAllControls ();
@@ -465,10 +465,15 @@
{
if (Msg->GadgetID == _R(IDC_BIASGAINCOMBO))
{
- WORD DropdownListIndex;
- GetValueIndex( _R(IDC_BIASGAINCOMBO), &DropdownListIndex );
+// WORD DropdownListIndex;
+// GetValueIndex( _R(IDC_BIASGAINCOMBO), &DropdownListIndex );
+ int iSelected = m_pobddStandardProfile->GetSelected();
+ if (iSelected == -1)
+ break;
+
+ DWORD dwSelected = (DWORD)iSelected;
- switch( DropdownListIndex )
+ switch(dwSelected)
{
// get preset value to match the dropdown list index
//
@@ -485,7 +490,7 @@
EnableAllControls ();
}
- BiasGainGadget.GetPresetBiasGainValue( DropdownListIndex, BiasGain_m );
+ BiasGainGadget.GetPresetBiasGainValue(dwSelected, BiasGain_m );
InitSliders( BiasGain_m );
InitEditBoxes( BiasGain_m );
InvalidateGadget( _R(IDC_CURVE) );
@@ -1029,16 +1034,19 @@
m_pobddStandardProfile = NULL;
}
- m_pobddStandardProfile = new CBitmapDropDown;
+ m_pobddStandardProfile = new CBitmapGridDropDown;
m_pobddStandardProfile->Init(WindowID, _R(IDC_BIASGAINCOMBO));
- m_pobddStandardProfile->AddItem(_R(IDB_PROFILE1), _T(""));
- m_pobddStandardProfile->AddItem(_R(IDB_PROFILE2), _T(""));
- m_pobddStandardProfile->AddItem(_R(IDB_PROFILE3), _T(""));
- m_pobddStandardProfile->AddItem(_R(IDB_PROFILE4), _T(""));
- m_pobddStandardProfile->AddItem(_R(IDB_PROFILE5), _T(""));
+ m_pobddStandardProfile->SetColumns(1);
+ m_pobddStandardProfile->SetItemSize(wxSize(21, 21));
- m_pobddStandardProfile->SetUnselectedIntem(_R(IDB_PROFILE6), _T(""));
+ m_pobddStandardProfile->AddItem(_R(IDB_PROFILE1));
+ m_pobddStandardProfile->AddItem(_R(IDB_PROFILE2));
+ m_pobddStandardProfile->AddItem(_R(IDB_PROFILE3));
+ m_pobddStandardProfile->AddItem(_R(IDB_PROFILE4));
+ m_pobddStandardProfile->AddItem(_R(IDB_PROFILE5));
+
+ m_pobddStandardProfile->SetUnselectedItem(_R(IDB_PROFILE6));
}
@@ -1055,7 +1063,7 @@
{
INT32 iProfileIndex = BiasGainGadget.FindPresetBiasGain(BiasGain);
- m_pobddStandardProfile->SetSelectedIndex(iProfileIndex);
+ m_pobddStandardProfile->SetSelected(iProfileIndex);
}
@@ -1152,7 +1160,7 @@
else if (bMany == TRUE) // we need to display the many setting ....
{
// SetCustomComboGadgetValue ( _R(IDC_BIASGAINCOMBO), (CustomComboBoxControlDataItem*) NULL, TRUE, -1);
- m_pobddStandardProfile->SetSelectedIndex(-1);
+ m_pobddStandardProfile->SetSelected(-1);
// and disable all other controls ....
DisableAllControls ();
@@ -1398,7 +1406,7 @@
// Make the profile control show a custom image (cause after all, now we have
// a custom bias/gain).
- m_pobddStandardProfile->SetSelectedIndex(-1);
+ m_pobddStandardProfile->SetSelected(-1);
// do general input handling
HandleInput( Message, BiasGain );
Index: Trunk/XaraLX/Kernel/biasdlg.h
===================================================================
--- Trunk/XaraLX/Kernel/biasdlg.h (revision 1701)
+++ Trunk/XaraLX/Kernel/biasdlg.h (revision 1702)
@@ -107,7 +107,7 @@
#include "transop.h"//"selop.h"
#include "biasgain.h"
#include "biasgdgt.h"
-#include "bitmapdropdown.h"
+#include "bitmapgriddropdown.h"
@@ -233,7 +233,7 @@
// identifier for this particular instance
CGadgetID Id_m;
- CBitmapDropDown* m_pobddStandardProfile;
+ CBitmapGridDropDown* m_pobddStandardProfile;
// the curve representation
CProfileBiasGain BiasGain_m;
Index: Trunk/XaraLX/wxXtra/wxXtra.h
===================================================================
--- Trunk/XaraLX/wxXtra/wxXtra.h (revision 1701)
+++ Trunk/XaraLX/wxXtra/wxXtra.h (revision 1702)
@@ -21,3 +21,5 @@
#include "xh_treebk.h"
#include "slidercombo.h"
#include "xh_slidrcombo.h"
+#include "gridcombo.h"
+#include "xh_gridcombo.h"
Index: Trunk/XaraLX/wxXtra/Makefile.am
===================================================================
--- Trunk/XaraLX/wxXtra/Makefile.am (revision 1701)
+++ Trunk/XaraLX/wxXtra/Makefile.am (revision 1702)
@@ -9,7 +9,8 @@
libwxXtra_a_SOURCES = \
framemanager.cpp floatpane.cpp dockart.cpp \
doublebuffer.cpp cwfrompoint.cpp combo.cpp combog.cpp odcombo.cpp xh_odcombo.cpp\
- platform.cpp advsplash.cpp treebook.cpp xh_treebk.cpp slidercombo.cpp xh_slidrcombo.cpp
+ platform.cpp advsplash.cpp treebook.cpp xh_treebk.cpp slidercombo.cpp xh_slidrcombo.cpp\
+ gridcombo.cpp xh_gridcombo.cpp
# make sure this does NOT have our include files in the path
# Don't use GTK includes for now - you will need this with sub-2.6.3 but that's not supported
Index: Trunk/XaraLX/wxOil/camresource.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camresource.cpp (revision 1701)
+++ Trunk/XaraLX/wxOil/camresource.cpp (revision 1702)
@@ -96,7 +96,6 @@
=================================XARAHEADEREND============================
*/
-
#include "camtypes.h"
//#include "camconfig.h"
@@ -1461,6 +1460,7 @@
#if WXXTRA_TREEBOOK
wxXmlResource::Get()->AddHandler(new wxTreebookXmlHandler);
#endif
+ wxXmlResource::Get()->AddHandler(new wxGridComboXmlHandler);
#endif
if (!pwxFileSystem) pwxFileSystem = new wxFileSystem;
Index: Trunk/XaraLX/wxOil/dlgevt.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgevt.cpp (revision 1701)
+++ Trunk/XaraLX/wxOil/dlgevt.cpp (revision 1702)
@@ -106,6 +106,7 @@
//#include "dialogop.h" - in camtypes.h [AUTOMATICALLY REMOVED]
#include "ctrllist.h"
#include "dropdown.h"
+#include "griddropdown.h"
const TCHAR * DialogEventHandler::DefaultString = _T("[Event Name Not Found]
EventNumberToName * DialogEventHandler::pHash = NULL;
@@ -530,6 +531,7 @@
if (pwxWindow)
{
DropDown::KillDropDownsByWindow(pwxWindow);
+ CGridDropDown::KillDropDownsByWindow(pwxWindow);
ControlList::Get()->RemoveWindowAndChildren(pwxWindow);
}
Index: Trunk/XaraLX/wxOil/Makefile.am
===================================================================
--- Trunk/XaraLX/wxOil/Makefile.am (revision 1701)
+++ Trunk/XaraLX/wxOil/Makefile.am (revision 1702)
@@ -40,7 +40,7 @@
binreloc.c exceptio.cpp colpick.cpp dragpick.cpp sgldrag.cpp cctime.cpp \
lddirect.cpp prncamvw.cpp prdlgctl.cpp psdc.cpp grndprnt.cpp printprg.cpp \
oilruler.cpp bitmapdropdown.cpp helptabs.cpp tmplmngr.cpp imgmgkft.cpp ppmfiltr.cpp \
- resources.cpp
+ resources.cpp bitmapgriddropdown.cpp griddropdown.cpp
# Keep resources.cpp on a separate line as it is odd
Index: Trunk/XaraLX/wxOil/xrc/EN/biasres.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/biasres.xrc (revision 1701)
+++ Trunk/XaraLX/wxOil/xrc/EN/biasres.xrc (revision 1702)
@@ -48,9 +48,9 @@
<pos>5,129d</pos> <size>90,15d</size>
<style>wxSL_HORIZONTAL</style>
</object>
- <object class="wxOwnerDrawnComboBox" name="IDC_BIASGAINCOMBO">
+ <object class="wxGridCombo" name="IDC_BIASGAINCOMBO">
<pos>7,7d</pos> <size>24,-1d</size>
- <style>wxCB_READONLY|wxTE_PROCESS_ENTER</style>
+ <style>wxCB_READONLY</style>
</object>
<object class="wxTextCtrl" name="IDC_EDIT_BIAS">
<pos>95,102d</pos> <size>22,12d</size>
Index: Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc (revision 1701)
+++ Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc (revision 1702)
@@ -4267,12 +4267,12 @@
<object class="sizeritem">
<flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
<border>0</border>
- <object class="wxOwnerDrawnComboBox" name="IDC_BITMAPEFFECT">
+ <object class="wxGridCombo" name="IDC_BITMAPEFFECT">
<size>128,-1</size>
<font>
<size>8</size>
</font>
- <style>wxCB_READONLY|wxTE_PROCESS_ENTER</style>
+ <style>wxCB_READONLY</style>
<buttonsize>17,-1</buttonsize>
<tooltip>Fill effect</tooltip>
<help>Choose how the fill fades from one colour to another</help>
@@ -4407,12 +4407,12 @@
<object class="sizeritem">
<flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
<border>0</border>
- <object class="wxOwnerDrawnComboBox" name="IDC_BITMAPEFFECT">
+ <object class="wxGridCombo" name="IDC_BITMAPEFFECT">
<size>128,-1</size>
<font>
<size>8</size>
</font>
- <style>wxCB_READONLY|wxTE_PROCESS_ENTER</style>
+ <style>wxCB_READONLY</style>
<buttonsize>17,-1</buttonsize>
<tooltip>Fill effect</tooltip>
<help>Choose how the fill fades from one colour to another</help>
@@ -5853,12 +5853,12 @@
<object class="sizeritem">
<flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
<border>0</border>
- <object class="wxOwnerDrawnComboBox" name="IDC_BRUSHTYPE">
+ <object class="wxGridCombo" name="IDC_BRUSHTYPE">
<size>80,-1</size>
<font>
<size>8</size>
</font>
- <style>wxCB_READONLY|wxTE_PROCESS_ENTER</style>
+ <style>wxCB_READONLY</style>
<buttonsize>17,-1</buttonsize>
<tooltip>Select an existing brush</tooltip>
<help>Select an existing brush</help>
@@ -5872,12 +5872,12 @@
<object class="sizeritem">
<flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
<border>0</border>
- <object class="wxOwnerDrawnComboBox" name="IDC_STROKETYPE">
+ <object class="wxGridCombo" name="IDC_STROKETYPE">
<size>80,-1</size>
<font>
<size>8</size>
</font>
- <style>wxCB_READONLY|wxTE_PROCESS_ENTER</style>
+ <style>wxCB_READONLY</style>
<buttonsize>17,-1</buttonsize>
<tooltip>Select an existing stroke shape / pressure profile</tooltip>
<help>Select an existing stroke shape / pressure profile</help>
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp (revision 1701)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp (revision 1702)
@@ -131,6 +131,7 @@
//#include "palman.h"
#include "stack.h"
#include "dropdown.h" // Colour/Font dropdown combo box support
+#include "griddropdown.h"
#include "unicdman.h"
#include "appprefs.h"
#include "helpuser.h"
@@ -1932,6 +1933,7 @@
// Kill of Dropdowns
DropDown::KillDropDownsByWindow(WindowID);
+ CGridDropDown::KillDropDownsByWindow(WindowID);
// Remove new-form control list
ControlList::Get()->RemoveWindowAndChildren((wxWindow *)WindowID);
Xara