kreisende Label
-
Ich habe ein Menue erstellt, beim click auf Start sollen mittels einer schleife(for) die labels einmal selbsttätig von label_1 bis label_4 wandern(sie sind im Kreis angeordnet).
Jeder label soll ca 1 Sekunde angezeigt werden und bei label_1 anhalten.
Mein Versuch steht unten u. ist gekennzeichnet, es klappt nicht ganz.// Declarations added here will be included at the top of the .HPP file
[cpp]
class __Form1_declspec Form1 : public __Form1_Base
{public:
// add your public instance data hereprivate:
WBool _Set_Text(void); // add your private instance data here
WInt _text_nr;
WInt _DeuEng;
WInt _um1;
WInt i;
protected:
// add your protected instance data here};
// Code added here will be included at the top of the .CPP file
WBool Form1::_Set_Text(void)
{
/*if (_text_nr == 0 & _DeuEng == 0)
{ _um1 = 0;}if (_text_nr == 1 & _DeuEng == 0)
{ _um1 = 1;}if (_text_nr == 1 & _DeuEng == 1)
{ _um1 = 2;}if (_text_nr == 1 & _DeuEng == 2)
{_um1 = 3; } */_um1=(_um1+1)%4;//dadurch springt der Wert am Ende auf 0 zurück
switch (_um1)
{
case 0:
cb_1->SetText( "Text weiterschalten" );
label_1->SetText( "1 Text Position" );
label_2->SetText( " " );
label_3->SetText( " " );
label_4->SetText( " " );
break;
case 1:
cb_1->SetText( "Text weiterschalten" );
label_1->SetText( "" );
label_2->SetText( "2 Text Position " );
label_3->SetText( "" );
label_4->SetText( " " );break;
case 2:
cb_1->SetText( "Text weiterschalten" );
label_1->SetText( "" );
label_2->SetText( "" );
label_3->SetText( " 3 Text Position " );
label_4->SetText( " " );break;
case 3:
cb_1->SetText( "Text weiterschalten" );label_1->SetText( " " );
label_2->SetText( " " );
label_3->SetText( " " );
label_4->SetText( "4 Text Position " );break;
}
return FALSE;
}// Include definitions for resources.
#include "WRes.h"Form1::Form1()
{
_text_nr = 0; //KONSTRUKTOR
_DeuEng = 0;
i = 0;
}Form1::~Form1()
{}
WBool Form1::menu_1_ErstePosition_Click(
WObject * source,
WEventData * event )
{
label_1->SetText( "1 Text Position " );
label_2->SetText( " " );
label_3->SetText( " " );
label_4->SetText( " " );
if (_text_nr == 0 & _DeuEng == 0)
{ _um1 = 0;}
return FALSE;
}WBool Form1::menu_1_ZweitePosition_Click(
WObject * source,
WEventData * event )
{
label_1->SetText( " " );
label_2->SetText( "2 Text Position " );
label_3->SetText( " " );
label_4->SetText( " " );
if (_text_nr == 0 & _DeuEng == 0)
{ _um1 = 1;}
return FALSE;
}WBool Form1::menu_1_DrittePosition_Click(
WObject * source,
WEventData * event )
{
label_1->SetText( " " );
label_2->SetText( " " );
label_3->SetText( " 3 Text Position" );
label_4->SetText( " " );
if (_text_nr == 0 & _DeuEng == 0)
{ _um1 = 2;}
return FALSE;
}WBool Form1::menu_1_ViertePosition_Click(
WObject * source,
WEventData * event )
{
label_1->SetText( " " );
label_2->SetText( " " );
label_3->SetText( " " );
label_4->SetText( " 4 Text Position" );
if (_text_nr == 0 & _DeuEng == 0)
{_um1 = 3; }
return FALSE;
}WBool Form1::menu_1_Start_Click(
WObject * source,
WEventData * event )
{
if (_text_nr == 0)
_text_nr = 0;else
//_text_nr = 1;
for(_text_nr =1 ; _DeuEng<4; _text_nr ++ );////----------- >>>//ZAEHLSCHLEIFE_Set_Text();
return FALSE;
}
WBool Form1::cb_1_Click(
WObject * source,
WEventData * event )
{
if (_text_nr == 0)
_text_nr = 0;else
_text_nr = 1;
_Set_Text();return FALSE;
}[cpp]
-
Labels, Forms,...
All das gibt es in Standard C++ nicht.
-
Hallo,
welchen Compiler und welche Klassenbibliothek verwendest du?
-
HumeSikkins schrieb:
Hallo,
welchen Compiler und welche Klassenbibliothek verwendest du?Power++
Gruß Renate
-
AberHallo schrieb:
Labels, Forms,...
All das gibt es in Standard C++ nicht.
Und sie existieren doch!!!!!
-
Dieser Thread wurde von Moderator/in HumeSikkins aus dem Forum C++ in das Forum Compiler-Forum verschoben.
Im Zweifelsfall bitte auch folgende Hinweise beachten:
C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?Dieses Posting wurde automatisch erzeugt.