AeTabPanelUI.c++
1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include <assert.h>
#include <stdlib.h>
#include <Vk/VkTabPanel.h>
#include "AeBinView.h"
#include "AeBinEditor.h"
void
AeBinView::TabCreate (void)
{
fTabpanel = new VkTabPanel ("tabpanel", _baseWidget);
fTabpanel->show();
XtVaSetValues (
fTabpanel->baseWidget(),
XmNtopAttachment, XmATTACH_NONE,
XmNbottomAttachment, XmATTACH_FORM,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNtopPosition, 0,
XmNbottomPosition, 0,
XmNrightPosition, 0,
XmNtopOffset, 0,
XmNbottomOffset, 8,
XmNleftOffset, 0,
XmNrightOffset, 0,
(XtPointer) NULL);
// setup callback routines
fTabpanel->addCallback (VkTabPanel::tabSelectCallback, (VkCallbackObject *)this, (VkCallbackMethod)&AeBinView::TabSelectCallback, NULL);
}
void
AeBinView::TabSetLabels (void)
{
int numBins;
String * tabLabels = NULL;
int i;
assert (fTabpanel);
assert (fEditor);
numBins = fEditor->GetNumBins ();
if ((tabLabels = (String *)malloc (numBins * sizeof (String))) == NULL)
goto Exit;
fEditor->GetBinNames (tabLabels);
for (i=0; i<numBins; i++)
fTabpanel->addTab (tabLabels[i], NULL, False);
Exit:
if (tabLabels)
free (tabLabels);
}
void
AeBinView::TabSelectName (String name)
{
assert (fTabpanel);
assert (name);
fTabpanel->selectTab (name);
}
void
AeBinView::TabSelectCallback (VkCallbackObject * object, void * clientData, void * callData)
{
VkTabCallbackStruct * tabData = (VkTabCallbackStruct *)callData;
assert (fEditor);
fEditor->SetIndexedBinUI (tabData->tabIndex);
}