Vitus
Resource contributor
- Messages
- 1,480
- Country
Hello again,
once again I made an attempt to understand programming c gauges. Once again I am stuck.
First, I tried to compile the SDK samples. Didn't work. Then I tried to compile the samples provided with Dais programming tutorial. Didn't work. Then I tried to set up an easy gauge with a static graphic, using parts of both, SDK and Dais tutorial. Finally Visual Studio was able to compile it! But after integrating it into the 2D panel, it just don't show up.
Here is what I did.
main.cpp:
annunciator.cpp:
All graphics are correctly integrated in the resource file, filename and ID are correctly set.
main.h:
After several attempts I integrated a second graphic (MAKE_ICON) and linked it to a graphic copied from the MS SDK. One assumption was, that my graphics are stored in a wrong bmp format. Bad shot.
Any ideas what I made wrong?
Regards from Downunder
Vitus
once again I made an attempt to understand programming c gauges. Once again I am stuck.
First, I tried to compile the SDK samples. Didn't work. Then I tried to compile the samples provided with Dais programming tutorial. Didn't work. Then I tried to set up an easy gauge with a static graphic, using parts of both, SDK and Dais tutorial. Finally Visual Studio was able to compile it! But after integrating it into the 2D panel, it just don't show up.
Here is what I did.
main.cpp:
Code:
[...]
#define GAUGE_NAME "annunciator"
#define GAUGEHDR_VAR_NAME gaugehdr_annunciator
#define GAUGE_W 100
#include "subgauges/annunciator.cpp"
GAUGE_TABLE_BEGIN()
GAUGE_TABLE_ENTRY(&gaugehdr_annunciator)
GAUGE_TABLE_END()
annunciator.cpp:
Code:
//Gauge header
char annunciator_gauge_name[] = GAUGE_NAME;
extern PELEMENT_HEADER annunciator_list;
extern MOUSERECT annunciator_mouse_rect[];
GAUGE_HEADER_FS700(GAUGE_W, annunciator_gauge_name, &annunciator_list,annunciator_mouse_rect,0,0,0,0 );
/////////////////////////////////////////////////////////////////////////////
MAKE_ICON( test_icon,
BMP_TEST,
NULL,
NULL,
IMAGE_USE_ERASE || IMAGE_USE_TRANSPARENCY,
0,
10,10,
MODULE_VAR_NONE,
NULL,
ICON_SWITCH_TYPE_SET_CUR_ICON,
1,
0,
0 )
PELEMENT_HEADER pTstLst[] =
{
&test_icon.header,
NULL
};
MAKE_STATIC(
annunciator_bg,
BMP_TEST,
pTstLst,
NULL,
IMAGE_USE_TRANSPARENCY,
0,
0, 0 )
PELEMENT_HEADER annunciator_list = &annunciator_bg.header;
MOUSE_BEGIN(annunciator_mouse_rect,0,0,0)
MOUSE_END
#undef GAUGE_NAME
#undef GAUGEHDR_VAR_NAME
#undef GAUGE_W
All graphics are correctly integrated in the resource file, filename and ID are correctly set.
main.h:
Code:
[...]
#define BMP_ANNUNCIATOR_BG 0x1000
#define BMP_ANNUNCIATOR_L_OIL 0x1100
#define BMP_TEST 0x1200
[...]
After several attempts I integrated a second graphic (MAKE_ICON) and linked it to a graphic copied from the MS SDK. One assumption was, that my graphics are stored in a wrong bmp format. Bad shot.
Any ideas what I made wrong?
Regards from Downunder
Vitus