unit TntClassMethod; interface uses AcroMultiClassMethod,tntClasses,Graphics,tntComCtrls; procedure Proc_TtntActionList(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); procedure Replace_TtntListView_Columns(AView:TtntCustomListView; ATable:IDataLocate;ACodePage,ASeqNo:string); procedure Replace_TtntListView_Items(AView:TtntCustomListView; ATable:IDataLocate;ACodePage,ASeqNo:string); implementation uses tntStdctrls,tntExtCtrls,tntControls,Menus,tntMenus,tntActnList,tntButtons,tntForms; ...{Class-Method} procedure Replace_TtntListView_Columns(AView:TtntCustomListView; ATable:IDataLocate;ACodePage,ASeqNo:string); var i:integer; LV:TtntListView; begin LV:=TtntListView(AView); LV.Columns.BeginUpdate; try for i:=0 to LV.Columns.Count-1do begin LV.Columns[i].Caption:=GetDisplayValue(ATable,LV.Columns[i].Caption, ACodePage,ASeqNo); end; finally LV.Columns.EndUpdate; end; end; procedure Replace_TtntListView_Items(AView:TtntCustomListView; ATable:IDataLocate;ACodePage,ASeqNo:string); var i,j:integer; LV:TtntListView; begin LV:=TtntListView(AView); LV.Items.BeginUpdate; try for i:=0 to LV.Items.Count-1do begin LV.Items[i].Caption:=GetDisplayValue(ATable,LV.Items[i].Caption, ACodePage,ASeqNo); for j:=0 to LV.Items[i].SubItems.Count-1do LV.Items[i].SubItems[j]:=GetDisplayValue(ATable,LV.Items[i].SubItems[j], ACodePage,ASeqNo); end; finally LV.Items.EndUpdate; end; end; procedure Proc_TtntMenuItem(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); procedure ChangeAMenuItem(AMI:TtntMenuItem); var i:integer; begin AMI.Caption:=GetDisplayValue(ATable,AMI.Caption,ACodePage,ASeqNo); AMI.Hint:=GetDisplayValue(ATable,AMI.Hint,ACodePage,ASeqNo); for i:=0 to AMI.Count-1do begin ChangeAMenuItem(TtntMenuItem(AMI[i])); end; end; begin ChangeAMenuItem(TtntMenuItem(AComponent)); end; procedure Proc_TtntTabControl(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); var i:integer; begin for i:=0 to TtntTabControl(AComponent).Tabs.Count-1do begin TtntTabControl(AComponent).Tabs[i]:=GetDisplayValue(ATable,TtntTabControl(AComponent).Tabs[i],ACodePage,ASeqNo); end; end; procedure Proc_TtntTreeView(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); var i:integer; ANode:TtntTreeNode; begin TtntTreeView(AComponent).Items.BeginUpdate; try for i:=0 tO TtntTreeView(AComponent).Items.Count-1do begin ANode:=TtntTreeView(AComponent).Items[i]; ANode.Text:=GetDisplayValue(ATable,ANode.Text,ACodePage,ASeqNo); end; finally TtntTreeView(AComponent).Items.EndUpdate; end; end; procedure Proc_TtntListView(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); var i,j:integer; LV:TtntListView; begin LV:=TtntListView(AComponent); LV.Columns.BeginUpdate; LV.Items.BeginUpdate; try for i:=0 to LV.Columns.Count-1do begin LV.Columns[i].Caption:=GetDisplayValue(ATable,LV.Columns[i].Caption, ACodePage,ASeqNo); end; for i:=0 to LV.Items.Count-1do begin LV.Items[i].Caption:=GetDisplayValue(ATable,LV.Items[i].Caption, ACodePage,ASeqNo); for j:=0 to LV.Items[i].SubItems.Count-1do LV.Items[i].SubItems[j]:=GetDisplayValue(ATable,LV.Items[i].SubItems[j], ACodePage,ASeqNo); end; finally LV.Items.EndUpdate; LV.Columns.EndUpdate; end; end; procedure Proc_TtntComboBox(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); var i,Index:integer; vIsSorted:Boolean; begin TtntComboBox(AComponent).Items.BeginUpdate; try Index:=TtntComboBox(AComponent).ItemIndex; vIsSorted:=false; if TtntComboBox(AComponent).Items is TtntStringList then begin vIsSorted:=TtntStringList(TtntComboBox(AComponent).Items).Sorted; TtntStringList(TtntComboBox(AComponent).Items).Sorted:=false; end; for i:=0 to TtntComboBox(AComponent).Items.Count-1do TtntComboBox(AComponent).Items[i]:= GetDisplayValue(ATable,TtntComboBox(AComponent).Items[i],ACodePage,ASeqNo); TtntComboBox(AComponent).ItemIndex:=Index; if TtntComboBox(AComponent).Items is TtntStringList then TtntStringList(TtntComboBox(AComponent).Items).Sorted:=vIsSorted; finally TtntComboBox(AComponent).Items.EndUpdate; end; end; procedure Proc_TtntStatusBar(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); var i:integer; begin TtntStatusBar(AComponent).Panels.BeginUpdate; try for i:=0 to TtntStatusBar(AComponent).Panels.Count-1do begin TtntStatusBar(AComponent).Panels[i].Text:=GetDisplayValue(ATable, TtntStatusBar(AComponent).Panels[i].Text,ACodePage,ASeqNo); end; finally TtntStatusBar(AComponent).Panels.EndUpdate; end; end; procedure Proc_TtntListBox(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); var i,Index:integer; begin TtntListBox(AComponent).Items.BeginUpdate; try index:=TtntListBox(AComponent).ItemIndex; for i:=0 to TtntListBox(AComponent).Items.Count-1do TtntListBox(AComponent).Items[i]:= GetDisplayValue(ATable,TtntListBox(AComponent).Items[i],ACodePage,ASeqNo); TtntListBox(AComponent).ItemIndex:=Index; finally TtntListBox(AComponent).Items.EndUpdate; end; end; procedure Proc_TtntActionList(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); var i:integer; ACA:TtntAction; begin for i:=0 to TtntActionList(AComponent).ActionCount-1do begin if TtntActionList(AComponent).Actions[i] is TtntAction then begin ACA:=TtntAction(TtntActionList(AComponent).Actions[i]); ACA.Caption:=GetDisplayValue(ATable,ACA.Caption,ACodePage,ASeqNo); ACA.Hint:=GetDisplayValue(ATable,ACA.Hint,ACodePage,ASeqNo); end; end; end; procedure Proc_TtntPanel(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); begin TtntPanel(AComponent).Caption:= GetDisplayValue(ATable,TtntPanel(AComponent).Caption,ACodePage,ASeqNo); end; procedure Proc_TtntGroupBox(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); begin TtntGroupBox(AComponent).Caption:= GetDisplayValue(ATable,TtntGroupBox(AComponent).Caption,ACodePage,ASeqNo); end; procedure Proc_TtntPageControl(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); var i:integer; begin for i:=0 to TtntPageControl(AComponent).PageCount-1do TtntPageControl(AComponent).Pages[i].Caption:= GetDisplayValue(ATable,TtntPageControl(AComponent).Pages[i].Caption, ACodePage,ASeqNo); end; procedure Proc_TtntButton(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); begin TtntButton(AComponent).Caption:= GetDisplayValue(ATable,TtntButton(AComponent).Caption, ACodePage,ASeqNo); end; procedure Proc_TtntLabel(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); begin TtntLabel(AComponent).Caption:= GetDisplayValue(ATable,TtntLabel(AComponent).Caption,ACodePage,ASeqNo); end; procedure Proc_TtntSpeedButton(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); begin TtntSpeedButton(AComponent).Caption:= GetDisplayValue(ATable,TtntSpeedButton(AComponent).Caption,ACodePage,ASeqNo); end; procedure Proc_TtntBitbtn(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); begin TtntBitbtn(AComponent).Caption:= GetDisplayValue(ATable,TtntBitbtn(AComponent).Caption,ACodePage,ASeqNo); end; procedure Proc_TtntToolBar(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); var i:integer; begin TtntToolBar(AComponent).Caption:= GetDisplayValue(ATable,TtntToolBar(AComponent).Caption,ACodePage,ASeqNo); for i:=0 to TtntToolBar(AComponent).ButtonCount-1do TtntToolBar(AComponent).Buttons[i].Caption:= GetDisplayValue(ATable,TtntToolBar(AComponent).Buttons[i].Caption,ACodePage,ASeqNo); end; procedure Proc_TtntForm(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); begin TtntForm(AComponent).Caption:= GetDisplayValue(ATable,TtntForm(AComponent).Caption,ACodePage,ASeqNo); end; procedure Proc_TtntStaticText(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); begin TtntStaticText(AComponent).Caption:= GetDisplayValue(ATable,TtntStaticText(AComponent).Caption,ACodePage,ASeqNo); end; procedure Proc_TtntRadioButton(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); begin TtntRadioButton(AComponent).Caption:= GetDisplayValue(ATable,TtntRadioButton(AComponent).Caption,ACodePage,ASeqNo); end; procedure Proc_TtntCheckBox(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); begin TtntCheckBox(AComponent).Caption:= GetDisplayValue(ATable,TtntCheckBox(AComponent).Caption,ACodePage,ASeqNo); end; procedure Proc_TtntRadioGroup(ATable:IDataLocate;AComponent:TObject; ACodePage,ASeqNo:string;AFont:TFont); var i:integer; begin TtntRadioGroup(AComponent).Items.BeginUpdate; try TtntRadioGroup(AComponent).Caption:= GetDisplayValue(ATable,TtntRadioGroup(AComponent).Caption,ACodePage,ASeqNo); for i:=0 to TtntRadioGroup(AComponent).Items.Count-1do begin TtntRadioGroup(AComponent).Items[i]:= GetDisplayValue(ATable,TtntRadioGroup(AComponent).Items[i],ACodePage,ASeqNo); end; finally TtntRadioGroup(AComponent).Items.EndUpdate; end; end; initialization AcroClassMethodStorage.RegisterClassMethod(TtntPanel ,Proc_TtntPanel); AcroClassMethodStorage.RegisterClassMethod(TtntGroupBox ,Proc_TtntGroupBox); AcroClassMethodStorage.RegisterClassMethod(TtntStaticText ,Proc_TtntStaticText); AcroClassMethodStorage.RegisterClassMethod(TtntTabControl ,Proc_TtntTabControl); AcroClassMethodStorage.RegisterClassMethod(TtntPageControl ,Proc_TtntPageControl); AcroClassMethodStorage.RegisterClassMethod(TtntButton ,Proc_TtntButton); AcroClassMethodStorage.RegisterClassMethod(TtntSpeedButton ,Proc_TtntSpeedButton); AcroClassMethodStorage.RegisterClassMethod(TtntBitbtn ,Proc_TtntBitbtn); AcroClassMethodStorage.RegisterClassMethod(TtntComboBox ,Proc_TtntComboBox); AcroClassMethodStorage.RegisterClassMethod(TtntTreeView ,Proc_TtntTreeView); AcroClassMethodStorage.RegisterClassMethod(TtntListView ,Proc_TtntListView); AcroClassMethodStorage.RegisterClassMethod(TtntListBox ,Proc_TtntListBox); AcroClassMethodStorage.RegisterClassMethod(TtntStatusBar ,Proc_TtntStatusBar); AcroClassMethodStorage.RegisterClassMethod(TtntLabel ,Proc_TtntLabel); AcroClassMethodStorage.RegisterClassMethod(TtntToolBar ,Proc_TtntToolBar); AcroClassMethodStorage.RegisterClassMethod(TtntForm ,Proc_TtntForm); AcroClassMethodStorage.RegisterClassMethod(TtntMenuItem ,Proc_TtntMenuItem); AcroClassMethodStorage.RegisterClassMethod(TtntRadioButton ,Proc_TtntRadioButton); AcroClassMethodStorage.RegisterClassMethod(TtntRadioGroup ,Proc_TtntRadioGroup); AcroClassMethodStorage.RegisterClassMethod(TtntCheckBox ,Proc_TtntCheckBox); finalization AcroClassMethodStorage.UnRegisterClassMethod(TtntPanel); AcroClassMethodStorage.UnRegisterClassMethod(TtntGroupBox); AcroClassMethodStorage.UnRegisterClassMethod(TtntStaticText); AcroClassMethodStorage.UnRegisterClassMethod(TtntTabControl); AcroClassMethodStorage.UnRegisterClassMethod(TtntPageControl); AcroClassMethodStorage.UnRegisterClassMethod(TtntButton); AcroClassMethodStorage.UnRegisterClassMethod(TtntSpeedButton); AcroClassMethodStorage.UnRegisterClassMethod(TtntBitbtn); AcroClassMethodStorage.UnRegisterClassMethod(TtntComboBox); AcroClassMethodStorage.UnRegisterClassMethod(TtntTreeView); AcroClassMethodStorage.UnRegisterClassMethod(TtntListView); AcroClassMethodStorage.UnRegisterClassMethod(TtntListBox); AcroClassMethodStorage.UnRegisterClassMethod(TtntStatusBar); AcroClassMethodStorage.UnRegisterClassMethod(TtntLabel); AcroClassMethodStorage.UnRegisterClassMethod(TtntToolBar); AcroClassMethodStorage.UnRegisterClassMethod(TtntForm); AcroClassMethodStorage.UnRegisterClassMethod(TtntMenuItem); AcroClassMethodStorage.UnRegisterClassMethod(TtntRadioButton); AcroClassMethodStorage.UnRegisterClassMethod(TtntRadioGroup); AcroClassMethodStorage.UnRegisterClassMethod(TtntCheckBox); end.