.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Paletteset startup location

8 REPLIES 8
Reply
Message 1 of 9
mohnston
906 Views, 8 Replies

Paletteset startup location

I can't seem to get my paletteset to start up in any location but docked on the left.
I've tried setting the Location property, the Dock property (see below) and many other combinations.
I would like it to start as a floating paletteset.

I found other posts regarding this issue but the solution was a workaround that didn't make sense. I am hoping that there is a better answer. Do you have it?

[code]
static PaletteSet ps;

public static void ShowPalette()
{
//
if (ps == null)
{
ps = new PaletteSet("Finishes");
ps.Style = PaletteSetStyles.ShowCloseButton |
PaletteSetStyles.Snappable |
PaletteSetStyles.ShowCloseButton |
PaletteSetStyles.ShowAutoHideButton;
ps.MinimumSize = new System.Drawing.Size(420, 320);
ps.Add("Finishes", new uControlAssign());
ps.Dock = DockSides.None;
}

ps.Visible = true;
}
[/code]

It must be one of two things:
1. It is really simple and I'm a fool for not seeing it.
2. It is really simple but there is a bug so it doesn't work like you would expect.
Either way I'm going to hate the answer.
CAD Programming Solutions
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: mohnston

How about this:

ps.DockEnabled = DockStyle.None;
ps.Dock = DockStyle.None;

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5547284@discussion.autodesk.com...
I can't seem to get my paletteset to start up in any location but docked on the left.
I've tried setting the Location property, the Dock property (see below) and many other combinations.
I would like it to start as a floating paletteset.

I found other posts regarding this issue but the solution was a workaround that didn't make sense. I am hoping that there is a better answer. Do you have it?

[code]
static PaletteSet ps;

public static void ShowPalette()
{
//
if (ps == null)
{
ps = new PaletteSet("Finishes");
ps.Style = PaletteSetStyles.ShowCloseButton |
PaletteSetStyles.Snappable |
PaletteSetStyles.ShowCloseButton |
PaletteSetStyles.ShowAutoHideButton;
ps.MinimumSize = new System.Drawing.Size(420, 320);
ps.Add("Finishes", new uControlAssign());
ps.Dock = DockSides.None;
}

ps.Visible = true;
}
[/code]

It must be one of two things:
1. It is really simple and I'm a fool for not seeing it.
2. It is really simple but there is a bug so it doesn't work like you would expect.
Either way I'm going to hate the answer.
Message 3 of 9
mohnston
in reply to: mohnston

Hi Tony,
I assumed you meant:
ps.DockEnabled = DockSides.None;
ps.Dock = DockSides.None;
as I didn't notice a DockStyle property.

Anyway, I tried that and my palette is still docked on left on startup.
The only clue so far is that if I assign a GUID when I create the ps the location and state are saved and will return on the next run.
Ex: ps = new PaletteSet("Finishes", new Guid(my32CharGUIDStringWith4Dashes))
That doesn't solve the problem of having the palette float on first run.
CAD Programming Solutions
Message 4 of 9
Anonymous
in reply to: mohnston

Mark - Yes, sorry its DockSides, not DockStyle.

I was going from memory 🙂

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5547882@discussion.autodesk.com...
Hi Tony,
I assumed you meant:
ps.DockEnabled = DockSides.None;
ps.Dock = DockSides.None;
as I didn't notice a DockStyle property.

Anyway, I tried that and my palette is still docked on left on startup.
The only clue so far is that if I assign a GUID when I create the ps the location and state are saved and will return on the next run.
Ex: ps = new PaletteSet("Finishes", new Guid(my32CharGUIDStringWith4Dashes))
That doesn't solve the problem of having the palette float on first run.
Message 5 of 9
pavlos.katsonis
in reply to: mohnston

Actually, the reason for this unexpected behavior is quite stupid. You have to assign the Dock property after the Visible property.
Autodesk is consistent to failing to include vital information for Object ARX in its "notes" ('cause obviously the "ObjectARX Reference" can not be characterized Documentation or Reference)

This should work:

static PaletteSet ps;

public static void ShowPalette()
{
//
if (ps == null)
{
ps = new PaletteSet("Finishes");
ps.Style = PaletteSetStyles.ShowCloseButton |
PaletteSetStyles.Snappable |
PaletteSetStyles.ShowCloseButton |
PaletteSetStyles.ShowAutoHideButton;
ps.MinimumSize = new System.Drawing.Size(420, 320);
ps.Add("Finishes", new uControlAssign());
}

ps.Visible = true;
ps.Dock = DockSides.None;
}
Message 6 of 9
Anonymous
in reply to: mohnston

Pavlos - Thanks for clearing that up.

I generally don't bother with Dock and DockEnable and
just let the user put it where they want it, so I've never
come across this.

Come to think of it, I just posted some helper classes for
PaletteSets, and I think I'll update it to accomodate this
ummmm feature:

http://www.caddzone.com/ExtensionApplicationBlock.zip

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5548170@discussion.autodesk.com...
Actually, the reason for this unexpected behavior is quite stupid. You have to assign the Dock property after the Visible property.
Autodesk is consistent to failing to include vital information for Object ARX in its "notes" ('cause obviously the "ObjectARX Reference" can not be characterized Documentation or Reference)

This should work:

static PaletteSet ps;

public static void ShowPalette()
{
//
if (ps == null)
{
ps = new PaletteSet("Finishes");
ps.Style = PaletteSetStyles.ShowCloseButton |
PaletteSetStyles.Snappable |
PaletteSetStyles.ShowCloseButton |
PaletteSetStyles.ShowAutoHideButton;
ps.MinimumSize = new System.Drawing.Size(420, 320);
ps.Add("Finishes", new uControlAssign());
}

ps.Visible = true;
ps.Dock = DockSides.None;
}
Message 7 of 9
Anonymous
in reply to: mohnston

Well I just tried making that change, and I have
to tell you that it's a bigger mess than I thought.

It works the first time the paletteset is used, but
after that (once AutoCAD persists the docking and
other information and tries to restore it the next
time the same palletset is shown), it doesn't work
very well, and the paletteset ends up being docked
in the MDI client window.

So, I give up.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5548170@discussion.autodesk.com...
Actually, the reason for this unexpected behavior is quite stupid. You have to assign the Dock property after the Visible property.
Autodesk is consistent to failing to include vital information for Object ARX in its "notes" ('cause obviously the "ObjectARX Reference" can not be characterized Documentation or Reference)

This should work:

static PaletteSet ps;

public static void ShowPalette()
{
//
if (ps == null)
{
ps = new PaletteSet("Finishes");
ps.Style = PaletteSetStyles.ShowCloseButton |
PaletteSetStyles.Snappable |
PaletteSetStyles.ShowCloseButton |
PaletteSetStyles.ShowAutoHideButton;
ps.MinimumSize = new System.Drawing.Size(420, 320);
ps.Add("Finishes", new uControlAssign());
}

ps.Visible = true;
ps.Dock = DockSides.None;
}
Message 8 of 9
RonnieWilkins
in reply to: mohnston

Tony,

Are you adding the GUID? The following code is what I haves used in many applications and it works great except the very first time ever run the graphics are a little messed up.

The next time around all is well.


using AcWi = Autodesk.AutoCAD.Windows;
paletteSet = new AcWi.PaletteSet("PalletSetName", new Guid("{B8D4069D-0458-4aac-9809-140A8C722759}"));
paletteSet.Add("My Pallete Set", new PlotUI());
paletteSet.Style = AcWi.PaletteSetStyles.UsePaletteNameAsTitleForSingle | AcWi.PaletteSetStyles.Snappable | AcWi.PaletteSetStyles.ShowAutoHideButton;
paletteSet.MinimumSize = new Size(450, 0xae);
paletteSet.DockEnabled = AcWi.DockSides.None;
paletteSet.Location = new Point(20, 20);
paletteSet.Visible = true;
paletteSet.Dock = AcWi.DockSides.None;
Ronnie Wilkins, Jr.
Message 9 of 9
Anonymous
in reply to: mohnston

There's an updated version of the file I posted
a link to earlier, which accepts a [Guid] attribute
to use as the persistence key.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5551259@discussion.autodesk.com...
Tony,

Are you adding the GUID? The following code is what I haves used in many applications and it works great except the very first time ever run the graphics are a little messed up.

The next time around all is well.


using AcWi = Autodesk.AutoCAD.Windows;
paletteSet = new AcWi.PaletteSet("PalletSetName", new Guid("{B8D4069D-0458-4aac-9809-140A8C722759}"));
paletteSet.Add("My Pallete Set", new PlotUI());
paletteSet.Style = AcWi.PaletteSetStyles.UsePaletteNameAsTitleForSingle | AcWi.PaletteSetStyles.Snappable | AcWi.PaletteSetStyles.ShowAutoHideButton;
paletteSet.MinimumSize = new Size(450, 0xae);
paletteSet.DockEnabled = AcWi.DockSides.None;
paletteSet.Location = new Point(20, 20);
paletteSet.Visible = true;
paletteSet.Dock = AcWi.DockSides.None

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost