MainU.cpp
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:7k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "MainU.h"
  5. #include "OutlookBarU.h"
  6. #include "PaintU.h"
  7. #include "ImageTabFormU.h"
  8. #include "ColorDemoU.h"
  9. #include "TabButtons.h"
  10. #include "TreeDemo.h"
  11. #include "ImageButtonU.h"
  12. #include "MapU.h"
  13. #include "ShapeU.h"
  14. #include "DBTreeSample.h"
  15. #include "ImagerMain.h"
  16. #include "LabelU.h"
  17. #include "StatusBarU.h"
  18. #include "ProportionalU.h"
  19. #include "OrderFormU.h"
  20. #include "ButtonGroupDemo.h"
  21. #include "TreeCombos.h"
  22. #include "TilerUnit.h"
  23. #include "FrameU.h"
  24. //---------------------------------------------------------------------------
  25. #pragma package(smart_init)
  26. #pragma link "fcButton"
  27. #pragma link "fcButtonGroup"
  28. #pragma link "fcClearPanel"
  29. #pragma link "fcDemoRichEdit"
  30. #pragma link "fcImage"
  31. #pragma link "fcImageForm"
  32. #pragma link "fcImgBtn"
  33. #pragma link "fcLabel"
  34. #pragma link "fcOutlookBar"
  35. #pragma link "fcShapeBtn"
  36. #pragma resource "*.dfm"
  37. TMainForm *MainForm;
  38. //---------------------------------------------------------------------------
  39. __fastcall TMainForm::TMainForm(TComponent* Owner)
  40.         : TForm(Owner)
  41. {
  42. }
  43. //---------------------------------------------------------------------------
  44. void __fastcall TMainForm::fcButtonGroup1Change(
  45.       TfcCustomButtonGroup *ButtonGroup, TfcButtonGroupItem *OldSelected,
  46.       TfcButtonGroupItem *Selected)
  47. {
  48.   // Color Active Button's Font and reset old font
  49.   if (OldSelected != NULL) OldSelected->Button->Font->Color = clWhite;
  50.   Selected->Button->Font->Color = clYellow;
  51.   PageControl1->ActivePage = (TTabSheet *)FindComponent("TabSheet" + IntToStr(Selected->Button->Tag));
  52.   fcOutlookBar1->ActivePage = (TfcCustomBitBtn *)FindComponent("RichEditPage" + IntToStr(Selected->Button->Tag));
  53.   TitleLabel->Caption = Selected->Button->Caption;
  54. }
  55. //---------------------------------------------------------------------------
  56. void TMainForm::ExecuteDemo(TForm* AForm) {
  57.   Screen->Cursor = crHourGlass;
  58.   Screen->Cursor = crDefault;
  59.   AForm->ShowModal();
  60.   AForm->Free();
  61. }
  62. //---------------------------------------------------------------------------
  63. void __fastcall TMainForm::fcShapeBtn8Click(TObject *Sender)
  64. {
  65.   ExecuteDemo(&TOutlookBarForm(Application));
  66. }
  67. //---------------------------------------------------------------------------
  68. void __fastcall TMainForm::DemoButtonOutlookBarClick(TObject *Sender)
  69. {
  70.   ExecuteDemo(&TPaintForm(Application));
  71. }
  72. //---------------------------------------------------------------------------
  73. void __fastcall TMainForm::DemoButtonTreeViewClick(TObject *Sender)
  74. {
  75.   ExecuteDemo(&TTreeViewDemoForm(Application));
  76. }
  77. //---------------------------------------------------------------------------
  78. void __fastcall TMainForm::DemoButtonDBTreeViewClick(TObject *Sender)
  79. {
  80.   ExecuteDemo(&TDMTreeViewForm(Application));
  81. }
  82. //---------------------------------------------------------------------------
  83. void __fastcall TMainForm::DemoButtonImageFormClick(TObject *Sender)
  84. {
  85.   ExecuteDemo(&TOrderForm(Application));
  86. }
  87. //---------------------------------------------------------------------------
  88. void __fastcall TMainForm::fcShapeBtn4Click(TObject *Sender)
  89. {
  90.   ExecuteDemo(&TImageTabForm(Application));
  91. }
  92. //---------------------------------------------------------------------------
  93. void __fastcall TMainForm::DemoButtonLabelClick(TObject *Sender)
  94. {
  95.   ExecuteDemo(&TLabelForm(Application));
  96. }
  97. //---------------------------------------------------------------------------
  98. void __fastcall TMainForm::DemoButtonShapeBtn1Click(TObject *Sender)
  99. {
  100.   ExecuteDemo(&TShapeBtnDemoForm(Application));
  101. }
  102. //---------------------------------------------------------------------------
  103. void __fastcall TMainForm::DemoButtonImageBtnClick(TObject *Sender)
  104. {
  105.   ExecuteDemo(&TImageBtnDemoForm(Application));
  106. }
  107. //---------------------------------------------------------------------------
  108. void __fastcall TMainForm::fcShapeBtn1Click(TObject *Sender)
  109. {
  110.   ExecuteDemo(&TMapForm(Application));
  111. }
  112. //---------------------------------------------------------------------------
  113. void __fastcall TMainForm::fcShapeBtn5Click(TObject *Sender)
  114. {
  115.   ExecuteDemo(&TButtonGroupDemoForm(Application));
  116. }
  117. //---------------------------------------------------------------------------
  118. void __fastcall TMainForm::fcShapeBtn2Click(TObject *Sender)
  119. {
  120.   ExecuteDemo(&TTabBtnGroupForm(Application));
  121. }
  122. //---------------------------------------------------------------------------
  123. void __fastcall TMainForm::DemoButtonButtonGroupClick(TObject *Sender)
  124. {
  125.   String s;
  126.   s = ExtractFileDir(Application->ExeName)+ "\ButtonGroup\PDemo1stClassMDI.exe";
  127.   ShellExecute(Handle, "OPEN", s.c_str(), NULL, NULL, SW_SHOWNORMAL);
  128. }
  129. //---------------------------------------------------------------------------
  130. void __fastcall TMainForm::DemoButtonColorClick(TObject *Sender)
  131. {
  132.   ExecuteDemo(&TColorDemoForm(Application));
  133. }
  134. //---------------------------------------------------------------------------
  135. void __fastcall TMainForm::DemoButtonTreeComboClick(TObject *Sender)
  136. {
  137.   ExecuteDemo(&TTreeComboDemoForm(Application));
  138. }
  139. //---------------------------------------------------------------------------
  140. void __fastcall TMainForm::DemoButtonStatusBarClick(TObject *Sender)
  141. {
  142.   ExecuteDemo(&TStatusBarDemoForm(Application));
  143. }
  144. //---------------------------------------------------------------------------
  145. void __fastcall TMainForm::fcShapeBtn7Click(TObject *Sender)
  146. {
  147.   ExecuteDemo(&TProportionalStatusBarForm(Application));
  148. }
  149. //---------------------------------------------------------------------------
  150. void __fastcall TMainForm::DemoButtonTilerClick(TObject *Sender)
  151. {
  152.   ExecuteDemo(&TTilerDemoForm(Application));
  153. }
  154. //---------------------------------------------------------------------------
  155. void __fastcall TMainForm::fcShapeBtn6Click(TObject *Sender)
  156. {
  157.   ExecuteDemo(&TImagerForm(Application));
  158. }
  159. //---------------------------------------------------------------------------
  160. void __fastcall TMainForm::fcShapeBtn3Click(TObject *Sender)
  161. {
  162.   Close();
  163. }
  164. //---------------------------------------------------------------------------
  165. void __fastcall TMainForm::FormShow(TObject *Sender)
  166. {
  167.   PageControl1->ActivePage = TabSheet1;
  168. }
  169. //---------------------------------------------------------------------------
  170. void __fastcall TMainForm::fcImageBtn2Click(TObject *Sender)
  171. {
  172.   ExecuteDemo(&TFrameDemoForm(Application));
  173. }
  174. //---------------------------------------------------------------------------