TAssistent V1.1 (C)1997 by Jens Rupp ( jens.rupp@stud.uni-erlangen.de ) This Software is Freeware! If you want the sourcode write me an E-Mail and answer this simple Qestions: - Why do you want the Sourcecode (to make modifikations, to study the technique, to HAVE the source etc) - In what Application will you use TAssistent (type,private,freeware,shareware,comercial etc) - What Improvements woud you like to see in the next Version ? - Have you found any BUGS ? - Where did you find it ? I think this is a fair Deal. Files Included in the archive: assi16.dcu Delphi 1 Component assi16.dcr Delphi 1 Component resource button16.res Delphi 1 Button resource assi32.dcu Delphi 2 Component assi32.dcr Delphi 2 Component resource button32.res Delphi 2 Button resource assi.txt This file history.txt History of TAssistant ADemo.dpr Simple Demo project (works with Delphi 1 and 2) Ademo.res Main.pas Main.dfm Form.pas Form.dfm assi.bmp Step by step Instruction: Creating the Dialog/Assistent form 1. Install the component (assi16 for Delphi 1 and assi32 for Delphi 2) 2. A Component Tab called Assistent appaears. It contains three Objects: Tassistent, TAbox, TAGroupBox 3. Start a new Project (Form1) 4. Create a new empty Form (Form2) 5. Put a Tassistent on Form2 6. Put a button on Form1 7. Double-click the button to create TForm1.Button1Click(Sender: TObject); 8. Insert the following lines between begin and end: form2.assistent1.page:=0; form2.showmodal; 9. Add Unit2 to the Uses line of Unit1 10. Compile it To see the Dialog/Assistent press the Button. To Change between Dialog and Assistent Mode press the Button in the lower left Corner. Adding Dialog Elements: 1. Activate the Tassitent Component 2. Put two TABox on the Assistent: ****************************** * ---------------------- * * | TABox1 | * * ---------------------- * * * * ---------------------- * * | TaBox2 | * * ---------------------- * * * *----------------------------* *Assistent Cancel Back Next* ****************************** 3. Put an Tedit in TaBox1 and TaBox2 4. Activate TaBox1 and Change the AssistentPage Property to 1 5. Activate TaBox2 and Change the AssistentPage Property to 2 6. Click the Assistent Button (without Starting the Programm) 7. Move TaBox1 to the center of the Assistent 8. Click on Next (to change to page 2) 9. Move Tabox2 to the center of the Assistent 10. Change back to Dialog Mode: the TaBoxes are at their original places 11. Start the Programm In Dialog mode both Edit components are on the same page, one above the middle and one below. In Assistent mode the Edit components are on different Pages and in the middle. Properties of Tassistent: AssistentHeight, AssistentWidth Size of the Form in Assistent Mode ButtonWidth Width of the Buttons DialogHeight, DialogWidth Size of the Form in Dialog Mode EndEnabled if True the Ok-Button is Enabled NumPages Number of Pages of the Assistent Page Actual Page: 0 Dialog 1-NumPages Assistent ShowAssistentOK If True an OK Button is shown in the lower right Corner of the Assistent. It can be disabled with the EndEnabled property. With this Button the user can end the Dialog befor reaching the last Page of the Assistent. ShowChangeButton If True the button to Change between Assistent and Dialog mode is visible. ShowGlyph If true the icons on the buttons are visible. To change the icons edit button16.res or button32.res and recompile (you need the source to do this) ShowHelpButton If True a Help button is shown TextAssitentName Text in the Caption of the Assistent. It is Formatted with the format command. First %d is the actual Page, second %d NumPages TextAssistentOK, TextBack, TextCancel, TextChangeAssistent, TextChangeDialog, TextDialogOK, TextFinish, TextHelp, TextNext Captions of the Buttons TextDialogName Text in the Caption of the Dialog Events of Tassistent CanPageChange: TCanPageChange = function(sender:tassistent;fromPage,toPage:integer):boolean of object; This Event is activated before a Page Switch. fromPage,toPage: 0 Dialog 1-NumPages Assistent -1 Finish/Ok was Pressed If the result is false the page is not switched. OnPageChange: TPageChangeEvent = procedure (sender:tassistent;page:integer) of object; This Event is activated after a Page Switch. page is the number of the activated page OnHelpClick: activated if the Help Button is Pressed Properties of TaBox Aleft,Atop Position in the Assistent Dleft,Dtop Position in the Dialog AssitentPage 0 Show not in Assitent 1-NumPages Show in Assitent -1 Show on all Assistent Pages ShowOnDialog If True it is shown in the Dialog Properties of TaGroupBox see TaBox Hints: - the Form can have different sizes in Dialog and Asssitent mode - if youe set showAssistentOK on true and endenabled to False you can enable the ok button in the canpagechange Event if all necessary data is available before reaching the last page - if you only want an assistent you can disable the Change Button - you can put a Button in a tabox which jumps to a special Page by setting the page property - to start the Form in Assitent mode set page to 1 before activating the Form - you can display Images by putting a timage in a tabox Jens