TCustomForm: Razlika med redakcijama
m (→Uporaba maske) |
m |
||
| Vrstica 301: | Vrstica 301: | ||
<source></source> | <source></source> | ||
| − | [[Category:Razredi]] | + | [[Category:Razredi|CustomForm]] |
| − | [[Category:SDMS Basic]] | + | [[Category:SDMS Basic|CustomForm]] |
Redakcija: 19:58, 29. november 2010
Razred TCustomForm je namenjen prikazovanju poljubne maske. To naj se nebi več uporabljalo, ampak se uporablja TDialog, ki ima tudi grafični urejevalnik dialoga.
Vsebina
Uporaba maske
Dim StartY, EndY, StartX, EndX as Float
Dim FDIA as TCustomForm
Dim L as Tlayer
Dim b, a as String,i as Long
FDIA = CreateCustomForm
FDIA.Caption = 'Elementi grida'
FDIA.CellWidth = 500
FDIA.CellSplit = 200
FDIA.CellHeight = 30
FDIA.AddTreeBox ('T1', "TreeBox", Layers)
FDIA.AddLabel ('L1', 'Labela - izpis teksta')
FDIA.AddEditBox ('E1', 'EditBox:')
FDIA.EditBoxValue ('E1') = '365000'
FDIA.AddCheckBox ('C1', 'CheckBox')
FDIA.CheckBoxValue ('C1') = True
FDIA.AddCheckListBox ('C2','CheckListBox','Polje1' + Line +'Polje2' + Line +'Polje3')
FDIA.AddComboBox ('C3','ComboBox','Polje1' + Line +'Polje2' +Line +'Polje3')
FDIA.AddListBox ('C4','ListBox','Polje1' + Line +'Polje2' +Line +'Polje3')
If FDIA.Execute Then
L = FDIA.TreeValue ('T1')
If Assigned (L) Then
b = L.Name
Else
b = 'Plast ni bila izbrana'
EndIF
a = FDIA.List ('C2')
i = FDIA.ListIndex ('C3')
Message ("Izbrano", b + line + a + IntTosTr(i))
EndIF
FDIA.DestroyExecute
Lastnost Execute odpre uporabniško definirano vnosno masko. Rezultat je True, če je uporabnik pritisnil gumk OK, sicer pa je rezultat False.
| RO Property TCustomForm.Execute As Boolean | ||
| Result | Boolean | . |
Destroy
Metoda Destroy uniči predhodno kreiran TCustomForm objekt.
| Method TCustomForm.Destroy |
Izgled maske
Caption
Lastnost Caption določa naslov vnosne maske.
| Property TCustomForm.Caption As String | ||
| Result | String | . |
CellHeight
Lastnost CellHeight določa velikost celice vnosne maske.
| Property TCustomForm.CellHeight As Long | ||
| Result | Long | . |
CellSplit
Lastnost CellSplit določa porazdelitev med napisom kontrole in samo kontrolo.
| Property TCustomForm.CellSplit As Long | ||
| Result | Long | . |
CellWidth
Lastnost CellWidth določa širino celice ali napisa celice na vnosni maski.
| Property TCustomForm.CellWidth As Long | ||
| Result | Long | . |
Dodajanje kontrol
AddCheckBox
Metoda AddCheckBox doda potrditveno polje na vnosno masko.
| Method TCustomForm.AddCheckBox (Name, Label As String) | ||
| Name | String | Ime kontrole. |
| Label | String | Tekst, ki se bo izpisal za kontrolo. |
AddCheckListBox
Metoda AddCheckListBox doda kontrolo listo potrditvenih polj na vnosno masko.
| Method TCustomForm.AddCheckListBox (Name, Label, Items As String) | ||
| Name | String | Ime kontrole. |
| Label | String | Tekst, ki se bo izpisal za kontrolo. |
| Items | String | Seznam imen psameznih potrditvenih polij, ki sestavljajo listo. Posamezna imena morajo biti med sabo ločene z vrstico ([[Line]]). |
AddComboBox
Metoda AddComboBox doda kombinirano polje na vnosno masko.
| Method TCustomForm.AddComboBox (Name, Label, Items As String) | ||
| Name | String | Ime kontrole. |
| Label | String | Tekst, ki se bo izpisal za kontrolo. |
| Items | String | Seznam stvari v listi. Posamezne stvari morajo biti med sabo ločene z vrstico ([[Line]]). |
AddDateBox
Metoda AddDateBox .
| Method TCustomForm.AddDateBox (Name, Label As String) | ||
| Name | String | Ime kontrole. |
| Label | String | Tekst, ki se bo izpisal za kontrolo. |
AddDirectoryBox
Metoda AddDirectoryBox .
| Method TCustomForm.AddDirectoryBox (Name, Label As String) | ||
| Name | String | Ime kontrole. |
| Label | String | Tekst, ki se bo izpisal za kontrolo. |
AddEditBox
Metoda AddEditBox doda editirno polje na vnosno masko.
| Method TCustomForm.AddEditBox (Name, Label As String) | ||
| Name | String | Ime kontrole. |
| Label | String | Tekst, ki se bo izpisal za kontrolo. |
AddLabel
Metoda AddLabel doda napisno polje na vnosno masko.
| Method TCustomForm.AddLabel (Name, Label As String) | ||
| Name | String | Ime kontrole. |
| Label | String | Tekst, ki se bo izpisal za kontrolo. |
AddListBox
Metoda AddListBox doda seznamsko polje na vnosno masko.
| Method TCustomForm.AddListBox (Name, Label, Items As String) | ||
| Name | String | Ime kontrole. |
| Label | String | Tekst, ki se bo izpisal za kontrolo. |
| Items | String | Seznam stvari, ki se dodajo v listo. Posamezne stvari morajo biti med sabo ločene z vrstico ([[Line]]). |
AddRadioBox
Metoda AddRadioBox .
| Method TCustomForm.AddRadioBox (Name, Label, Items As String) | ||
| Name | String | Ime kontrole. |
| Label | String | Tekst, ki se bo izpisal za kontrolo. |
| Items | String | . |
AddTreeBox
Metoda AddTreeBox doda drevesno strukturo na vnosno masko.
| Method TCustomForm.AddTreeBox (Name, Label As String, ObjType As TCollection) | ||
| Name | String | Ime kontrole. |
| Label | String | Tekst, ki se bo izpisal za kontrolo. |
| ObjType | TCollection | Objekt tipa TCollection, ki predstavlja izbor drevesne strukture. |
Lastnosti kontrol
Height
Lastnost Height določi ali vrne višino kontrole na vnosni maski.
| Property TCustomForm.Height (Name As String) As Long | ||
| Name | String | . |
| Result | Long | . |
Label
Lastnost Label določi ali vrne vrednost napisnega polja na vnosni maski.
| Property TCustomForm.Label (Name As String) As String | ||
| Name | String | . |
| Result | String | . |
List
Lastnost List lahko spremeni ali vrne stvari v seznamih seznamskih polij, kombiniranih polij ali listi potrditvenih polij.
| Property TCustomForm.List (Name As String) As String | ||
| Name | String | . |
| Result | String | . |
OnChangeEvent
Lastnost OnChangeEvent določa, katera procedura se bo izvedla vsakič, ko pride do spremembe vrednosti določene kontrole v maski. Navedena procedura mora imeti naslednjo sintakso:
Sub ImeProcedure (F As TCustomForm, ChangeName) As String| Property TCustomForm.OnChangeEvent (Name As String) As String | ||
| Name | String | . |
| Result | String | . |
...
CF.OnChangeEvent (T1) = "FormChange"
...
Sub FormChange (F As TCustomForm, CN As String)
Select case CN
Case 'C1'
If F.CheckBoxValue ('C1') Then
F.EditBoxValue ('E1') = 'Izbran'
Else
F.EditBoxValue ('E1') = 'Neizbran'
EndIf
EndSelect
EndSubTreeFolder
Lastnost TreeFolder .
| Property TCustomForm.TreeFolder (Name As String) As TFolder | ||
| Name | String | . |
| Result | TFolder | . |
TreeRoot
Lastnost TreeRoot .
| Property TCustomForm.TreeRoot (Name As String) As TFolder | ||
| Name | String | . |
| Result | TFolder | . |
Vrednosti v kontrol
CheckBoxValue
Lastnost CheckBoxValue nastavi ali vrne vrednost kontrolnega polja.
| Property TCustomForm.CheckBoxValue (Name As String) As Boolean | ||
| Name | String | . |
| Result | Boolean | . |
CheckListBoxValue
Lastnost CheckListBoxValue nastavi ali vrne vrednosti seznama kontrolnih polj na vnosni maski.
| Property TCustomForm.CheckListBoxValue (Name As String, Index As Long) As Boolean | ||
| Name | String | . |
| Index | Long | . |
| Result | Boolean | . |
EditBoxValue
Lastnost EditBoxValue nastavi ali vrne vrednost vnosnega polja.
| Property TCustomForm.EditBoxValue (Name As String) As String | ||
| Name | String | . |
| Result | String | . |
ListIndex
Lastnost ListIndex določa ali nastavi indeks izbrane stvari v kombiniranem ali potrditvenem polju.
| Property TCustomForm.ListIndex (Name As String) As Long | ||
| Name | String | . |
| Result | Long | . |
TreeValue
Lastnost TreeValue nastavi ali izbere objekt iz seznama drevesne strukture.
| Property TCustomForm.TreeValue (Name As String) As TClass | ||
| Name | String | . |
| Result | TClass | . |