Ich habe eine Klasse
CEditBox. Nun arbeite ich an einer weiteren
CExplorerBox welche u.a. die gleichen Eigenschaften wie die erste Klasse haben soll. Ich hab auch alle privaten Eigenschaften von
CEditBox mit dem Schlüsselwort "protected" versehen.
|
Quellcode
|
1
2
3
4
5
6
7
|
class CEditBox
{
protected:
...
public:
...
};
|
Dann erstelle ich ja die neue Klasse wie folgt:
|
Quellcode
|
1
2
3
4
5
6
7
|
class CExplorerBox : public CEditBox
{
private:
...
public:
...
};
|
Nun ist das Problem aber, das CEditBox einen umfangreichen Konstruktor hat, CExplorerBox aber auch einen Wert zusätzlich übernehmen soll.
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// Konstruktor von CEditBox
CEditBox(int x, int y, int w, int h, FONT * fnt): drawRect(false), centered(false), lineVal(0)
{
if (!(w > SCREEN_X || h > SCREEN_Y))
{
itsWidth = w; itsHeight = h;
itsX = x; itsY = y;
}
itsFnt = fnt;
surface = create_bitmap(SCREEN_X, SCREEN_Y);
surfaceCpy = create_bitmap(SCREEN_X, SCREEN_Y);
};
// Konstruktor von CExplorerBox
CExplorerBox (int job)
{
if (job > 2 || job < 0)
{
//printf(fError, "FEHLER: CExplorerBox-Objekt soll ungültige Arbeit übernehmen! -> %i\n", job);
itsFunction = FILE_BROWSER;
}
else itsFunction = job;
};
|
Ich weiß, dass beim Erstellen eines CExplorerBox-Objektes erst der Konstruktor von CEditBox und dann der von CExplorerBox aufgerufen wird.
Nur wie deklariere ich nun das CExplorerBox-Objekt?
|
Quellcode
|
1
|
CExplorerBox test( ? ? ? ? ? ? ? ? ?);
|
Helft mir!