Advertisement
Layth01

Untitled

Mar 30th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 2.36 KB | None | 0 0
  1. unit A2TopicSelectionUnit;
  2.  
  3. interface
  4.  
  5. uses
  6.   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  7.   Vcl.Controls, Vcl.Forms, Vcl.Dialogs , Vcl.StdCtrls;
  8.  
  9. type
  10.   TfrmA2TopicSelect = class(TForm)
  11.     lblTopics: TLabel;
  12.     btnRespiration: TButton;
  13.     btnPhotosynthesis: TButton;
  14.     btnExit: TButton;
  15.     procedure btnExitClick(Sender: TObject);
  16.     procedure btnRespirationClick(Sender: TObject);
  17.     procedure btnPhotosynthesisClick(Sender: TObject);
  18.     procedure FormCreate(Sender: TObject);
  19.   private
  20.     { Private declarations }
  21.   public
  22.     { Public declarations }
  23.   end;
  24.  
  25. var
  26.   frmA2TopicSelect: TfrmA2TopicSelect;
  27.  
  28. implementation
  29.  
  30. Uses
  31. RespirationQuestionsUnit , PhotosynthesisQuestionsUnit, StudentMenuUnit;
  32.  
  33. {$R *.dfm}
  34.  
  35. procedure TfrmA2TopicSelect.btnPhotosynthesisClick(Sender: TObject);
  36. begin
  37.   //open phtotosynthesis questions:
  38.   frmPhotosynthesisQuestions.Show;
  39.   frmA2TopicSelect.Hide;
  40.  
  41.  
  42.   //set the font colour to black for each missing word in photosyntheis questions
  43.   frmPhotosynthesisQuestions.edtMissingWord1.Font.Color := clBlack;
  44.   frmPhotosynthesisQuestions.edtMissingWord2.Font.Color := clBlack;
  45.   frmPhotosynthesisQuestions.edtMissingWord3.Font.Color := clBlack;
  46.   frmPhotosynthesisQuestions.edtMissingWord4.Font.Color := clBlack;
  47.   frmPhotosynthesisQuestions.edtMissingWord5.Font.Color := clBlack;
  48.  
  49.   //setting the missing words to blank in photosyntheis questions
  50.    frmPhotosynthesisQuestions.edtMissingWord1.Text := '';
  51.    frmPhotosynthesisQuestions.edtMissingWord2.Text := '';
  52.    frmPhotosynthesisQuestions.edtMissingWord3.Text := '';
  53.    frmPhotosynthesisQuestions.edtMissingWord4.Text := '';
  54.    frmPhotosynthesisQuestions.edtMissingWord5.Text := '';
  55.  
  56.    //enable the 'Submit Answers' button:
  57.    frmPhotosynthesisQuestions.btnAnswers.Enabled := True;
  58. end;
  59.  
  60. procedure TfrmA2TopicSelect.btnRespirationClick(Sender: TObject);
  61. begin
  62.   frmRespirationQuestions.Show;
  63.   frmA2TopicSelect.Hide;
  64. end;
  65.  
  66. procedure TfrmA2TopicSelect.FormCreate(Sender: TObject);
  67. begin
  68.     //disables close button (top-right corner):
  69.   EnableMenuItem( GetSystemMenu( handle, False ),SC_CLOSE, MF_BYCOMMAND or MF_GRAYED );
  70. end;
  71.  
  72. //close form - goes back to student menu:
  73. procedure TfrmA2TopicSelect.btnExitClick(Sender: TObject);
  74. begin
  75.   frmA2TopicSelect.Close;
  76.   frmStudentMenu.Show;
  77. end;
  78.  
  79. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement