Jump to content
Software FX Community

Annotation Groups can't be unmodifiable


User (Legacy)
 Share

Recommended Posts

(VC6, DLL Build 16) 

I'm noticing what I think is a bug with the annotation group objects.

Specifically, I can't get them to behave as if AllowModify = FALSE.

Here's the scenario:

I programmatically create three text objects and put them on the graph with

AllowModify and AllowMove both set to false. When I run the program,

everything works fine: I can select the text boxes, but I can't move them,

and all the modification toolbar selections grey out when they are selected.

So next I came up with the bright idea of grouping them all together.

However, when I select the group object at run-time, I can still modify it

using the toolbar (though I can't move it.) Unfortunately, this allows my

users to make all sorts of silly grapohs that I don't want them to.

Is this a bug or am I doing something wrong?

(Code is below.)

Andrew

// Create the title group.

IAnnGroupPtr pTitleGroup = pAnnList->Add((long)OBJECT_TYPE_GROUP);

// Chart title

IAnnTextPtr pText = pTitleGroup->Add((long)OBJECT_TYPE_TEXT);

pText->AllowMove = VARIANT_FALSE;

pText->AllowModify = VARIANT_FALSE;

pText->Attach(ATTACH_NONE, NULL);

pText->Top = 10;

pText->Left = 80;

pText->Height = 20;

pText->Width = 510;

pText->Align = LA_LEFT | LA_BASELINE;

pText->BkColor = CHART_TRANSPARENT;

pText->Text = "Main Title";

// First column of chart info.

pText = pTitleGroup->Add((long)OBJECT_TYPE_TEXT);

pText->AllowMove = VARIANT_FALSE;

pText->AllowModify = VARIANT_FALSE;

pText->Attach(ATTACH_NONE, NULL);

pText->Top = 30;

pText->Left = 80;

pText->Height = 50;

pText->Width = 250;

pText->BkColor = CHART_TRANSPARENT;

pText->Text = "Subtitle one";

// Second column of chart info.

pText = pTitleGroup->Add((long)OBJECT_TYPE_TEXT);

pText->AllowMove = VARIANT_FALSE;

pText->AllowModify = VARIANT_FALSE;

pText->Attach(ATTACH_NONE, NULL);

pText->Top = 30;

pText->Left = 330;

pText->Height = 50;

pText->Width = 180;

pText->BkColor = CHART_TRANSPARENT;

pText->Text = "Subtitle two";

// Finish off the group object.

pTitleGroup->Attach(ATTACH_NONE, NULL);

pTitleGroup->RecalcBounds();

pTitleGroup->Refresh( VARIANT_FALSE );

pTitleGroup->AllowMove = VARIANT_FALSE;

pTitleGroup->AllowModify = VARIANT_FALSE;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...