I am using LabWindows 5.0. I am using EasyTab to make tabbed panels on the main panel. When I resize the main panel, I also resize the tabbed panels. When this happens, the rows of tabs are sometimes shown distorted - as if the text was magnified. Clicking on the tabs restores them, but the distorted image is still visible to the right of the tabs. Is there any way around this? I have not been able to find any information about this problem anywhere else. I modified the demo project and it also has the same problem. Here is my simpdemo.c file, you will need to edit the main panel to be sizable and give it the callback function PANEL_callback:
#include /* Needed if linking in external compiler; harmless otherwise */
#include
#include "easytab.h"
#include "simpdemo.h"
int tabCtrl,tabheight,tabwidth;
int main (int argc, char *argv[])
{
int panel;
if (InitCVIRTE (0, argv, 0) == 0) /* Needed if linking in external compiler; harmless otherwise */
return -1; /* out of memory */
panel = LoadPanel(0, "simpdemo.uir", PANEL);
/* Two function calls and, Voila!, a tab sheet dialog */
tabCtrl = EasyTab_ConvertFromCanvas(panel, PANEL_CANVAS);
EasyTab_LoadPanels (panel, tabCtrl, 1, "simpdemo.uir", __CVIUserHInst, CONTROL, 0,
VALVES, 0, MONITOR, 0, CONFIG, 0, HELP, 0, 0);
DisplayPanel(panel);
//save the default canvas size
GetCtrlAttribute (panel,PANEL_CANVAS, ATTR_HEIGHT, &tabheight);
GetCtrlAttribute (panel,PANEL_CANVAS, ATTR_WIDTH, &tabwidth);
RunUserInterface();
return 0;
}
int CVICALLBACK DoneCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
if (event == EVENT_COMMIT)
QuitUserInterface(0);
return 0;
}
int CVICALLBACK PANEL_callback (int panel, int event, void *callbackData,
int eventData1, int eventData2)
{
int i,h,w,hadj,wadj;
switch (event)
{
case EVENT_PANEL_SIZE:
//get the panel size
GetPanelAttribute (panel, ATTR_HEIGHT, &h);
GetPanelAttribute (panel, ATTR_WIDTH, &w);
//get the growth
h=h-360;
if (h<0)
h=0;
w=w-381;
if (w<0)
w=0;
//get the active tab panel
EasyTab_GetAttribute (panel,tabCtrl,ATTR_EASY_TAB_ACTIVE_PANEL, &eventData1);
//size the canvas
SetCtrlAttribute (panel,PANEL_CANVAS, ATTR_HEIGHT, tabheight+h);
SetCtrlAttribute (panel,PANEL_CANVAS, ATTR_WIDTH, tabwidth+w);
//size the active tab panel
SetPanelAttribute (eventData1, ATTR_HEIGHT, tabheight+h);
SetPanelAttribute (eventData1, ATTR_WIDTH, tabwidth+w);
//update the panels
DisplayPanel(eventData1);
DisplayPanel(panel);
break;
}
return 0;
}