Blog Options
Archive
<< April 2024 >>-
Wednesday 24
- Expanding the StellarDS.io tooling -
Monday 22
- Easy Guide to Building a Pexels Gallery App with TMS WEB Core -
Wednesday 17
- New free component for sophisticated file uploads with TMS WEB Core -
Tuesday 16
- Closing the gap with TMS FNC UI Pack new additions -
Thursday 11
- Unveiling the Latest Enhancements in TMS VCL UI Pack -
Friday 5
- TMS components and Delphi and C++Builder 12.1 -
Wednesday 3
- Customizing the login page of your application using TMS Sphinx
- A Python library for using StellarDS.io effortlessly
- Introducing: How it Works with Holger - Building a Pexels gallery app with TMS WEB Core video series
- TMS FNC Cloud Pack with StellarDS.io backend: unparalleled productivity in VCL & FMX
Authors
- Bernard Roussely (1)
- Wagner Landgraf (82)
- Roman Yankovsky (2)
- Bart Holvoet (27)
- Aaron Decramer (18)
- Pieter Scheldeman (99)
- Nancy Lescouhier (32)
- Adrian Gallero (33)
- Bruno Fierens (404)
- Marcos Douglas B. Santos (5)
- Wagner R. Landgraf (1)
- Bradley Velghe (16)
- Bernard (2)
- Andrew Simard (86)
- Holger Flick (15)
- Gjalt Vanhouwaert (30)
- Tunde Keller (22)
- Masiha Zemarai (119)
Blog
All Blog Posts | Next Post | Previous PostWorking with Parameter controls : TParamLabel, TParamListBox, TParamCheckList, TParamTreeview
Bookmarks:Wednesday, January 21, 2009
Introduction
The parameter identifier is specified through the controls href tag in the anchor formatting. This takes the format of : <A href="param identifier">param value</A> Multiple parameter identifiers can be used in the control but must be unique through the control.The controls provide an easy interface to get and set parameter values with the Parameter[identifier:string]:string property.
Additional interfaces are available for the listbox based and treeview based controls, being :
// This gets or sets the parameter value in a listbox item ItemParameter[idx:Integer; identifier:string]:string;
//This gets or sets the parameter value in a treeview node NodeParameter[Node:TTreeNode; identifier]:string;
Select your tool : <A href="tool">Delphi</A> and OS : <A href="os">Windows</A>
The parameter values can here be obtained through :
var os,tool:string; tool := control.Parameter['tool']; os := control.Parameter['os'];
The parameter values can be set through :
control.Parameter['tool'] := 'Delphi'; control.Parameter['os'] := 'Windows';
Several ways exist to let the user change the parameter value, for which 3 events are used :
OnParamClick, OnParamList, OnParamPopup and further inplace editors can be specified.
By specifying in code:
The anchor for identifying the parameter can have 2 additional attributes, being CLASS and PROPS. The optional CLASS attribute can specify which inplace editor has to be used for the parameter. This can currently be : LIST, MENU, EDIT, SPIN, DATE- LIST : a listbox is used, the PROPS attribute specifies the listbox elements
- MENU : a popup menu is used, the PROPS attribute specifies the popup menu items
- EDIT : a simple inplace editor is used
- SPIN : an inplace spin editor is used
- DATE : an inplace date picker is used
Example :
Select your car here : <A href="car" class="LIST" props="BMW,Mercedes,Audi,Porsche,Ferrari">BMW</A>
or
Select the period from <A href="startdate" class="DATE">1/1/2001</A> to <A href="enddate" class="DATE">1/12/2001</A>
In a ParamTreeview, the dates could be retrieved using :
MyStartDate := StrToDate(ParamTreeview.NodeParameter[TheNode,'startdate']; MyEndtDate := StrToDate(ParamTreeview.NodeParameter[TheNode,'enddate'];
By using events:
By using events, inplace listbox editors or popup menu contents can be specified.OnParamClick :
This event returns the href and value of the parameter clicked. The value can be changed in code.
Example 1 : (this toggles the value between Delphi & C++Builder)
if (href = 'tool') and (value = 'Delphi') then value := 'C++Builder' else value := 'Delphi';
Example 2 : (this asks the user for the value)
if (href = 'os') then InputQuery('Operating system','Name',value);
OnParamList:
This event returns the href and value of the parameter clicked and allows setting of the values that will appear in the dropdown listbox. If the doPopup parameter is returned true, the dropdown list will appear. The values of the list can be set through the stringlist Values parameter.
Example :
doPopup := (href = 'tool'); values.Add('Delphi'); values.Add('C++Builder'); values.Add('JBuilder');
OnParamPopup:
This event is similar to the OnParamList except that it controls the popup menu for parameter selection. This event returns the href and value of the parameter clicked and allows setting of the values that will appear in the popup menu. If the doPopup parameter is returned true, the popup menu will appear. The values of the popup menu can be set through the stringlist Values parameter.
Example :
doPopup := (href = 'tool') or (href = 'os'); if (href = 'tool') then begin values.Add('Delphi'); values.Add('C++Builder'); values.Add('JBuilder'); end; if (href = 'os') then begin values.Add('Windows'); values.Add('Linux'); values.Add('Mac OS/X'); end;
Bruno Fierens
Bookmarks:
This blog post has not received any comments yet.
All Blog Posts | Next Post | Previous Post
×