FirstPanelClass Header File
The class1.h header file is generated as follows:
#ifndef __class1__header__
#define __class1__header__
#include <ilviews/gadgets/gadcont.h>
#include <ilviews/gadgets/textfd.h>
#include <ilviews/gadgets/msglabel.h>
#include <ilviews/gadgets/slider.h>
// -----------------------------------------------------------------
class FirstPanelClass
: public IlvGadgetContainer {
public:
FirstPanelClass(IlvDisplay* display,
const char* name,
const char* title,
IlvRect* size = 0,
IlBoolean useAccelerators = IlFalse,
IlBoolean visible = IlFalse,
IlUInt properties = 0,
IlvSystemView transientFor = 0)
: IlvGadgetContainer(display,
name,
title,
size ? *size : IlvRect(0, 0, 219, 58),
properties,
useAccelerators,
visible,
transientFor)
{ initialize(); }
FirstPanelClass(IlvAbstractView* parent,
IlvRect* size = 0,
IlBoolean useacc = IlFalse,
IlBoolean visible = IlTrue)
: IlvGadgetContainer(parent,
size ? *size : IlvRect(0, 0, 219, 58),
useacc,
visible)
{ initialize(); }
// ____________________________________________________________
virtual void SliderCB(IlvGraphic*);
IlvSlider* getSlider() const
{ return (IlvSlider*)getObject(“Slider”); }
IlvTextField* getTextField() const
{ return (IlvTextField*)getObject(“TextField”); }
protected:
void initialize();
};
#endif /* !__class1__header__*/
Header
The first lines of the class1.h panel class header file give the date and file location for the generated file. It also tells you what Rogue Wave Views version you are using.
Included Header Files
The following lines show the necessary header files for the generated class:
#include <ilviews/gadgets/gadcont.h>
#include <ilviews/gadgets/textfd.h>
#include <ilviews/gadgets/msglabel.h>
#include <ilviews/gadgets/slider.h>
For each object contained in the generated panel, Rogue Wave Views Studio searches for its associated header file. In our example, the class FirstPanelClass has to include the files <ilviews/gadgets/textfd.h>, <ilviews/gadgets/msglabel.h>, and <ilviews/gadgets/slider.h> for its text field, message label, and slider objects, respectively.
Base Class
Since we have not modified the base class name for
FirstPanelClass, the generated class is derived from
IlvGadgetContainer.
Constructors
Two public constructors are generated:
FirstPanelClass(IlvDisplay* display,
const char* name,
const char* title,
IlvRect* size = 0,
IlBoolean useAccelerators = IlFalse,
IlBoolean visible = IlFalse,
IlUInt properties = 0,
IlvSystemView transientFor = 0)
: IlvGadgetContainer(display,
name,
title,
size ? *size : IlvRect(0, 0, 219, 58),
properties,
useAccelerators,
visible,
transientFor)
{ initialize(); }
FirstPanelClass(IlvAbstractView* parent,
IlvRect* size = 0,
IlBoolean useacc = IlFalse,
IlBoolean visible = IlTrue)
: IlvGadgetContainer(parent,
size ? *size : IlvRect(0, 0, 219, 58),
useacc,
visible)
{ initialize(); }
The first constructor builds the panel as a main window. The second builds the panel as a part of a parent view that is an
IlvAbstractView.
Callback
Because the callback SliderCB is assigned to the slider, Rogue Wave Views Studio generates its related virtual member function:
virtual void SliderCB(IlvGraphic*);
Named Objects
Our two named objects, Slider and TextField, can be accessed by the following generated member functions:
IlvSlider* getSlider() const
{ return (IlvSlider*)getObject(“Slider”); }
IlvTextField* getTextField() const
{ return (IlvTextField*)getObject(“TextField”); }
If you do not want Rogue Wave Views Studio to generate these functions, turn off the Names toggle button in the Panel Class inspector (Options notebook page).
Version 6.1
Copyright © 2016, Rogue Wave Software, Inc. All Rights Reserved.