PtTrend in a vertical direction

How can I move PtTrend in a vertical direction? Pt_TREND_VERTICAL flag do
not help me…

// LH PtTrend Test
//
#include <Pt.h>
#include <Ph.h>
#include <Ap.h>

int timer_cb( PtWidget_t *, void *,PtCallbackInfo_t *);

int count_draw_s = 0;

PtWidget_t *pttrend_widget;

int main( int argc, char *argv[] )
{
PtWidget_t *window;
PhArea_t area;
PtArg_t args[10];
PtWidget_t *timer_widget;

if ((window = PtAppInit(NULL, &argc, argv, 0, NULL)) == NULL)
exit(1);

area.size.w = area.size.h = 500;
PtSetArg( &args[0], Pt_ARG_AREA, &area, 0 );
PtSetArg( &args[1], Pt_ARG_TREND_FLAGS, Pt_TREND_VERTICAL | Pt_GRID,
Pt_TREND_VERTICAL | Pt_GRID );
pttrend_widget = PtCreateWidget( PtTrend, window, 2, args );

// Timer Widget
PtSetArg( &args[0], Pt_ARG_TIMER_INITIAL, 10, 0);
PtSetArg( &args[1], Pt_ARG_TIMER_REPEAT, 10, 0 );
timer_widget = PtCreateWidget(PtTimer, window, 2, args);

PtAddCallback(timer_widget, Pt_CB_TIMER_ACTIVATE, &timer_cb, NULL );

PtRealizeWidget(window);

PtMainLoop();

return (EXIT_SUCCESS);
}


int timer_cb( PtWidget_t *widget, void *apinfo, PtCallbackInfo_t *cbinfo )
{

short value;
PtArg_t args[1];

/* eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;

value = count_draw_s++;

PtSetArg( &args[0], Pt_ARG_TREND_DATA, &value, 1 );
PtSetResources( pttrend_widget, 1, &args[0] );

return( Pt_CONTINUE );

}

Leonid Khait <lhait@diaspro.com> wrote:
: How can I move PtTrend in a vertical direction? Pt_TREND_VERTICAL flag do
: not help me…

I think it has to do with the way that you’re setting the flags:

: PtSetArg( &args[1], Pt_ARG_TREND_FLAGS, Pt_TREND_VERTICAL | Pt_GRID,
: Pt_TREND_VERTICAL | Pt_GRID );

The default flags are Pt_TREND_HORIZONTAL | Pt_GRID |
Pt_TREND_RIGHT_TO_LEFT | Pt_GRID_IS_TRANSLUCENT. Your code is ORing in
Pt_TREND_VERTICAL | Pt_GRID, but isn’t clearing the Pt_TREND_HORIZONTAL
or Pt_TREND_RIGHT_TO_LEFT flags. I guess that horizontal wins if you set
both the horizontal and vertical flags.

By the way, are you using QNX Neutrino? In Photon 1.14, the widget was
RtTrend, not PtTrend.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

No, in Photon 1.14 there is PtTrend in Contributed Widgets.
I solve problem by sourcse PtTrend correction in
/qnx4/phtk/src/contribution. The default PtTrend
source use only Pt_TREND_HORZ flag in PgDrawTrend().

“Steve Reid” <stever@qnx.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:badfnn$5s0$1@nntp.qnx.com

Leonid Khait <> lhait@diaspro.com> > wrote:
: How can I move PtTrend in a vertical direction? Pt_TREND_VERTICAL flag
do
: not help me…

I think it has to do with the way that you’re setting the flags:

: PtSetArg( &args[1], Pt_ARG_TREND_FLAGS, Pt_TREND_VERTICAL | Pt_GRID,
: Pt_TREND_VERTICAL | Pt_GRID );

The default flags are Pt_TREND_HORIZONTAL | Pt_GRID |
Pt_TREND_RIGHT_TO_LEFT | Pt_GRID_IS_TRANSLUCENT. Your code is ORing in
Pt_TREND_VERTICAL | Pt_GRID, but isn’t clearing the Pt_TREND_HORIZONTAL
or Pt_TREND_RIGHT_TO_LEFT flags. I guess that horizontal wins if you set
both the horizontal and vertical flags.

By the way, are you using QNX Neutrino? In Photon 1.14, the widget was
RtTrend, not PtTrend.


Steve Reid > stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems