Jump to content
Software FX Community

Q: Custom painting, PaintMarker, the order of PaintMarker events...


User (Legacy)
 Share

Recommended Posts

Hi,

Say, we want to draw 2D bar chart with 3 series and to draw

the custom curve (using Windows GDI functions) for each of

the series. Is it possible to do it so that the curve 1 is

drawn after the serie 1 is painted, then serie 2 to be

painted and then curve 2, then serie 3 and line 3? The

order 3-2-1 instead 1-2-3 is also acceptable. The goal is

to draw the curve so that the next drawn serie would

overpainted the parts of the curve thus creating visual

effect of some bars to be front and some back.

In other words, are there any fixed rules for order of

PaintMarker events? E.g. is there a rule that says that

first serie is painted first/last, etc.? I guess it is

not. If not, is there any way to get the desired result?

(The curve must be painted by GDI functions because it is

not possible to use another (auxiliary) serie to plot the

curve.)

I tried to use PaintMarker event to test what is possible

(Cfx4032.dll via #import in VC++ 6), but no event was

detected. The API help says that I should also add the

CT_PAINTMARKER flag to the Type property, but I did not find

the property in the generated tlh/tli files. I tried TypeEx

and the undocumented (?) TypeProp, but I was unsuccessful.

Could you give me any hint?

Thanks for your time and experience,

Petr

--

Petr Prikryl (prikrylp at skil dot cz)

Link to comment
Share on other sites

Thanks for the hint, I was never thinking this way.  I will try something

and post some sample later.

Petr

"SoftwareFX Support" wrote...

> You can create a "dummy" series as a place holder for your curve, then use

> the PaintMarker event to draw it. The PaintMarker event will be called at

> the time of drawing and will be called in the order in which point are to

be

> drawn. [...]

Link to comment
Share on other sites

Hi,

"SoftwareFX Support" wrote...

> You can create a "dummy" series as a place holder for your

> curve, then use the PaintMarker event to draw it. The

> PaintMarker event will be called at the time of drawing and

> will be called in the order in which point are to be drawn.

I tried to do that. However, I need to suppress painting of

the dummy serie. I am detecting PaintMarker events through

ICfxEvents interface in C++ application. I was thinking

about suppressing the default painting of the (say) bar when

detecting the PaintMarker event for the point of the dummy

serie and to draw something else instead. Is it the right

way to do it? Or should I set the properties of the serie

somehow to make it invisible instead of suppressing

painting?

The documentation shows the nRes parameter that can be used

to suppress the processing -- see:

Visual C++

A "special" parameter called nRes, this parameter is

initialized with 0 before calling the event handler, if you

want to return something different you can freely assign a

value to this parameter i.e:

void CCFXSAMDlg::OnLButtonDblClkChartfx1(short x, short y,

short nSerie, long nPoint, short FAR* nRes)

{

// Your Code

*nRes = 1;

}

However, this seems to belong to the alternative way of

detecting events via notifications sent to the message

queue. Is it possible to stop processing also when

ICfxEvents is used for detection of events?

Thanks,

Petr

--

Petr Prikryl (prikrylp at skil dot cz)

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...