Sign in to follow this  
Guest tilentur

Another one .. this one is more C/C++ stuff

Recommended Posts

now i have some troubles, "separanting" my code into more files ... i have the "main" file and the "graphics" file ... here's some codemain file:case PANEL_SERVICE_PRE_DRAW: { PELEMENT_STATIC_IMAGE pelement = (PELEMENT_STATIC_IMAGE)(pgauge->elements_list[0]); if( pelement ) { HDC hdc = pelement->hdc; PIXPOINT dim = pelement->image_data.final->dim; if( hdc ) { //risanje DrawSelectedButton( hdc, NewEcamPage, 1 ); } SET_OFF_SCREEN (pelement); } break; }..and the drawing code :)void DrawSelectedButton( HDC hdc, int button, int color ) { int L1_drawX, L1_drawY, L1_drawX2, L1_drawY2; int L2_drawX, L2_drawY, L2_drawX2, L2_drawY2; int L3_drawX, L3_drawY, L3_drawX2, L3_drawY2; int lineLength = 20; int lineVSpacing = 1; Graphics graphics(hdc); . . . //DRAWING graphics.DrawLine( &belo, L1_drawX, L1_drawY, L1_drawX2, L1_drawY2 ); graphics.DrawLine( &belo, L2_drawX, L2_drawY, L2_drawX2, L2_drawY2 ); graphics.DrawLine( &belo, L3_drawX, L3_drawY, L3_drawX2, L3_drawY2 ); }and here is the link too all the code!http://tistidrugi.com/~tilentur/slike/A320...ageSelector.rarTnx in advance!

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Perhaps you could tell us what your troubles are? With the code I mean..

Share this post


Link to post
Share on other sites

lol .. sorry forgot to write that :D .. well, nothing draws on the gauge .

Share this post


Link to post
Share on other sites

huh! Finaly i found the solution ... you must define PEN only after you created Graphics! here's exampleThe right way!....Graphics graphics(hdc);Pen sivo(Color(81, 81, 81, 76));Pen belo(Color(255, 255, 255, 255)); ...The Wrong way...Pen sivo(Color(81, 81, 81, 76));Pen belo(Color(255, 255, 255, 255));Graphics graphics(hdc);...hope this helps someone in future! :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this