home *** CD-ROM | disk | FTP | other *** search
- #include "MySCAPIWindow2.h"
- #include "SCAPIListItem.h"
- #include "SCAPIMessageBox.h"
-
- // Contructor - Destructor
-
- MySCAPIWindow2::MySCAPIWindow2( SCAPIApp* inAppP,
- char* inTitle,
- int inOriginx,
- int inOriginy,
- int inWidth,
- int inHeight )
-
- : SCAPIWindow( inAppP,
- inTitle,
- inOriginx,
- inOriginy,
- inWidth,
- inHeight )
- {
- int i;
-
- mMenuBarP = (MySCAPIMenuBar2*) new MySCAPIMenuBar2();
- AssociateMenuBar(mMenuBarP);
-
- mListP = (SCAPIList*) new SCAPIList( this,
- 50,
- 50,
- 100,
- 100 );
-
- mListP->Add( new SCAPIListItem("one") );
- mListP->Add( new SCAPIListItem("two") );
- mListP->Add( new SCAPIListItem("three") );
- mListP->Add( new SCAPIListItem("four"));
- mListP->Add( new SCAPIListItem("five") );
- mListP->Add( new SCAPIListItem("six") );
- mListP->Add( new SCAPIListItem("seven") );
- mListP->Add( new SCAPIListItem("eight") );
- mListP->Add( new SCAPIListItem("nine") );
- mListP->Add( new SCAPIListItem("ten") );
-
- mListP->Delete(0);
- mListP->Delete(3);
- mListP->Delete(mListP->GetLength() - 1);
-
- mListP->Add( new SCAPIListItem("youpi"), 5 );
-
- mListP->Select(0);
- mListP->Unselect(1);
- mListP->Select(2);
-
- for (i = 0; i < mListP->GetLength(); i++)
- {
- if ( mListP->IsSelected(i) )
- mListP->Unselect(i);
- else
- mListP->Select(i);
- }
-
- mStaticP = (SCAPIStatic*) new SCAPIStatic( "Static",
- this,
- 50,
- 15 );
-
- mTextFieldP = (SCAPITextField*) new SCAPITextField( this,
- 200,
- 50 );
-
- mTextFieldP->SetMaxNumChars(5);
- mTextFieldP->Set("34.6");
-
- mTextFieldP2 = (SCAPITextField*) new SCAPITextField( this,
- 200,
- 85 );
-
- mTextFieldP3 = (SCAPITextField*) new SCAPITextField( this,
- 200,
- 120 );
-
- char* youpi = mTextFieldP->Get();
- }
-
- MySCAPIWindow2::~MySCAPIWindow2()
- {
- delete mMenuBarP;
- delete mListP;
- delete mStaticP;
- delete mTextFieldP;
- delete mTextFieldP2;
- delete mTextFieldP3;
- }
-
-
- // Member functions
-
- void MySCAPIWindow2::ExecuteCommand(int inCommand)
- {
- switch (inCommand)
- {
- case 1500:
- SCAPIMessageBox::Info("Hello, this is an info message.");
- break;
-
- case 1501:
- SCAPIMessageBox::Question("Do you want to close this window?");
- break;
-
- case 1502:
- SCAPIMessageBox::Caution("Going further will erase your harddisk...");
- break;
-
- case 1503:
- SCAPIMessageBox::Alert("An error occured.");
- break;
- }
- }