home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- #include <vcl\vcl.h>
- #pragma hdrstop
-
- #include "Button.h"
- //---------------------------------------------------------------------------
- #pragma resource "*.dfm"
- TButtonForm *ButtonForm;
- //---------------------------------------------------------------------------
- __fastcall TButtonForm::TButtonForm(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TButtonForm::EnableAllButtonClick(TObject *Sender)
- {
- EnableButtons(this, Sender == EnableAllButton);
- }
- //---------------------------------------------------------------------
- void TButtonForm::EnableButtons(TForm* form, bool enable)
- {
- for (int i = 0;i<form->ComponentCount;i++) {
- TButton* button =
- dynamic_cast<TButton*>(form->Components[i]);
- if (button && button->Parent == form) button->Enabled = enable;
- }
- }
-