Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 526 to 540 of 888, page 36 of 60
<< previous next >>



Displaying custom tickmarks
Using the event OnGetTickMarkText it is easy to customize the value that is displayed for each tickmark on the TAdvTrackbar. This event is triggered for every tickmark to be displayed. In the example code snippet, this formats values as 0.1,0.2,0.3 etc....
procedure TForm1.FormCreate(Sender: TObject); begin advtrackbar1.TickMark.ShowText := true; end; procedure TForm1.AdvTrackBar1GetTickMarkText(Sender: TObject; Index: Integer; var value: string); var v: double; begin v := 0.1 * index; value := Format('%.1f',[v]); end;



Localizing strings
Workflow Studio provides an easy way to localize the strings. All strings used in user interface (messages, button captions, dialog texts, menu captions, etc.) are in a single file names wsLanguage.pas.
In the languages folder, included in Workflow Studio distribution, there are several wsLanguage.pas files available for different languages. Just pick the one you want and copy it to the official directory of your workflow studio source code.
If the language you want does not exist, you can translate it yourself. Just open wsLanguage.pas file and translate the strings to the language you want.
As a final alternative, you can translate the wsLanguage.txt file, also included in ws_languages.zip file, and send the new file to us. The advantage of this approach is that this file is easier to translate (you don't have to deal with pascal language) and can be included in the official Workflow Studio distribution. This way we keep track of changes in translable strings and all new strings are marked in the upcoming releases. This way, you will always know what is missing to translate, and do not need to do some kind of file comparison in every release of Workflow Studio.
So, in summary, to localize Workflow Studio strings:
Option 1
- Pick the correct wsLanguage.pas file from the ws_languages.zip file, according to the language you want. - Replace the official wsLanguage.pas (in source code directory) by the one you picked.
Option 2
- Translate the official wsLanguage.pas directly
Option 3
- Translate the wsLanguage.txt file and send it to us (support@tmssoftware.com). - We will send you back a translated wsLanguage.pas file and this translation will be included in official release.



Using the fill editor at runtime
For the TMS smooth controls series of components, a fill property is used that allows to set the fill characteristics of the various graphic elements in the controls. The controls come with a special fill edit dialog that is used at design time to allow the designer to customize fills for the components. This fill editor can be used at runtime as well. To do this, add the unit AdvSmoothFillEditor to the uses clause and add for example to edit the fill of a TAdvSmoothPanel on the form, following code:
procedure TForm2.Button1Click(Sender: TObject); var fd: TAdvSmoothFillEditorDialog; begin fd := TAdvSmoothFillEditorDialog.Create(self); try fd.Fill := AdvSmoothPanel1.Fill; if fd.Execute then AdvSmoothPanel1.Fill.Assign(fd.Fill); finally fd.Free; end; end;
TAdvSmoothFillEditorDialog* editor = new TAdvSmoothFillEditorDialog(this); editor->Fill = AdvSmoothPanel1->Fill; editor->Execute();



Adding a messagebox to query if it is allowed to effectively delete a PlannerItem
When the TMS T(DB)Planner.AutoInsDel is set to true, deleting a PlannerItem can be done by just selecting the PlannerItem and pressing DEL. To add a messagebox to query if it is allowed to effectively delete the PlannerItem, add following code to the OnItemDelete event:
procedure TForm2.Planner1ItemDelete(Sender: TObject; Item: TPlannerItem); begin if MessageDlg('Delete this item?',mtConfirmation,[mbYes,mbNo],0) = mrNo then Abort; end;



Adding a messagebox to query if it is allowed to effectively delete a PlannerItem
When the TMS T(DB)Planner.AutoInsDel is set to true, deleting a PlannerItem can be done by just selecting the PlannerItem and pressing DEL. To add a messagebox to query if it is allowed to effectively delete the PlannerItem, add following code to the OnItemDelete event:
procedure TForm2.Planner1ItemDelete(Sender: TObject; Item: TPlannerItem); begin if MessageDlg('Delete this item?',mtConfirmation,[mbYes,mbNo],0) = mrNo then Abort; end;



When try to install TAdvSpreadGrid, I get an error 'AdvSprd.pas(187): E2003 Undeclared identifier: "TVAlignment ... Could not compile used unit "AdvSprd.pas" "'
Add the unit AdvObj to the uses clause of AdvSprd.pas and this issue should be fixed.



What is the difference between TMS Advanced Charts for IntraWeb and TMS Advanced Charts
There is no difference.
TMS Advanced Charts for IntraWeb is equal to TMS Advanced Charts. The product contains chart components that can be used for VCL Windows application development as well as IntraWeb web application development.



Importing data with TAdvGridExcelIO in a grid that already contains data
With AdvGridExcelIO.GridStartCol / AdvGridExcelIO.GridStartRow, you can set the top left corner from where the import starts.



Setting a custom division on the X-Axis
With this code, you can switch of the autounits and set a custom division on the X-Axis:
AdvChartView1.Panes[0].Series[0].XAxis.AutoUnits := False; AdvChartView1.Panes[0].Series[0].XAxis.MajorUnit := 10; AdvChartView1.Panes[0].Series[0].XAxis.MinorUnit := 0;



Adding notes to menu items
When TAdvMainMenu.ShowNotes = true, additional lines in the MenuItem.Caption are shown as description for the item. Add the extra lines after separator character sequence '\n'. This can be used both at runtime and design time.
Code sample:
MenuItem.Caption := 'Caption text\nAdditional notes here';



Sending e-mails
There are several points in the workflow definition where an e-mail can be sent. An example is when a task instance is created for an user. If the task definition properties of this task instance is marked as "Send e-mail notification", an e-mail will be sent to the user notifying him that the task instance was created and assigned to him.
However, there is no built-in code to send e-mails in Workflow Studio. When an e-mail is to be sent, the event OnSendMail of TWorkflowStudio component is fired. So, if you want your workflow so support e-mail sending, create an event handler for TWorkflowStudio.OnSendMail event, and send the e-mail yourself from there, using your own method.
The signature for the OnSendMail event is below:
type TEmailInformation = record ToAddr: string; From: string; Bcc: string; Cc: string; Subject: string; Text: string; end; procedure(Sender: TObject; TaskIns: TTaskInstance; AUser: TWorkflowUser; AEmailInfo: TEmailInformation; var Sent: boolean) of object;
Set Sent parameter to true when the e-mail is sent. For extra information (you will often use only AEmailInfo), you can use TaskIns and AUser parameters to know which task instance generated the e-mail, and for each workflow user the e-mail is about to be sent.



Adding users and groups
Workflow Studio is strongly based on tasks, which in turn are always assigned to an user or a group of users. So, Workflow Studio does also need to use information about users and groups.
This can be done at the beginning of the program. The code below is an example that shows how to add users and groups to Workflow Studio.
{Add users and groups} With WorkflowStudio.UserManager do begin {Add all users} Users.Clear; Users.Add('1', 'John', 'john@domain'); Users.Add('2', 'Sarah', 'sarah@domain'); Users.Add('3', 'Scott', 'scott@domain'); Users.Add('4', 'Mario', 'mario@domain'); Users.Add('5', 'Tina', 'tina@domain'); {Add groups and specify which users belong to each group} Groups.Clear; With Groups.Add('managers') do begin UserIds.Add('1'); //John UserIds.Add('2'); //Sarah end; With Groups.Add('programmers') do begin UserIds.Add('3'); //Scott UserIds.Add('4'); //Mario UserIds.Add('5'); //Tina end; end;



Writing custom TWebUpdateWizard translation components
It is very simple to create a translated version of the TWebUpdateWizard by providing a TWebUpdateWizardLanguage component. To write a custom version, create a class that descends from TWebUpdateWizardLanguage, override the constructor and provided the translated texts.
As an example, this is the source code for the dutch translated version:
constructor TWebUpdateWizardDutch.Create(AOwner: TComponent); begin inherited; Welcome := 'Druk start om te beginnen met controleren voor applicatie updates ...'; StartButton := 'Start'; NextButton := 'Volgende'; ExitButton := 'Verlaten'; CancelButton := 'Annuleren'; RestartButton := 'Herstarten'; GetUpdateButton := 'Update'; NewVersionFound := 'Nieuwe version gevonden'; NewVersion := 'Nieuwe versie'; NoNewVersionAvail := 'Geen nieuwe versie beschikbaar.'; NewVersionAvail := 'Nieuwe versie beschikbaar.'; CurrentVersion := 'Huidige versie'; NoFilesFound := 'Geen bestanden gevonden voor update'; NoUpdateOnServer := 'geen update gevonden op server ...'; CannotConnect := 'Er kan geen verbinding met de update server tot stand gebracht worden of'; WhatsNew := 'Nieuw in update'; License := 'Licentie overeenkomst'; AcceptLicense := 'Ik aanvaard'; NotAcceptLicense := 'Ik aanvaard niet'; ComponentsAvail := 'Beschikbare applicatie componenten'; DownloadingFiles := 'Downloaden bestanden'; CurrentProgress := 'Vooruitgang huidig bestand'; TotalProgress := 'Totale vooruitgang'; UpdateComplete := 'Update volledig ...'; RestartInfo := 'Druk Herstarten om de nieuwe versie te starten.'; WhatsNewPopup := ‘Bekijken met kladblok’; LicensePopup := ‘Bekijken met kladblok’; end;



Using TWebUpdateWizard
Using TWebUpdate with the TWebUpdateWizard is straightforward. Drop the TWebUpdate and TWebUpdateWizard on the form, setup TWebUpdate and assign TWebUpdate to the TWebUpdateWizard.WebUpdate property. The wizard can be started by calling TWebUpdateWizard.Execute.
Additional options for the TWebUpdateWizard are:
AutoRun: when true, does not require the user to step through each step
AutoStart: when true, the user does not have to start the update process, it starts automatically
Billboard: sets the left image for the update wizard dialog
BillboardCenter: Boolean: When true, the image is centered
BillboardStretch: Boolean: When true, the billboard image is stretched
BillboardTop: integer: sets the top position of the billboard image
BillboardLeft: integer: sets the left position of the billboard image
BillboardWidth: integer: sets the width of the billboard image
BillboardHeight: integer: sets the height of the billboard image
BorderStyle: sets the border style for the update wizard dialog
Caption: sets the caption text for the update wizard dialog
Font: sets the font for the update wizard dialog
Language: sets the language for the update wizard dialog. By default, the language is English.
Position: sets the screen position of the update wizard dialog



TWebUpdate Debugging
In case something is not working as desired, it is often convenient to check what steps TWebUpdate has executed. This can be traced by setting TWebUpdate.Logging = true.
During execution, TWebUpdate will create a log file of all steps performed in the file WUPDATE.LOG (default filename or can be changed with TWebUpdate.LogFileName) If no path is specified, the log file will by default be created in the “My documents” folder.
When something doesn't work, you can always contact our support team. To have more insight in what exactly you're doing, send your INF file and the generated log file as well. With this information, we should be able to see what exactly is missing.