Programming Examples for Controls in the Dialog Editor

The following examples are for a new dialog called "Dialog1". Use the tools on the Toolbox bar in the dialog editor to create the dialog and add the following controls: a Check Box called "CheckBox1", a Label Field called "Label1", a Button called "CommandButton1", and a List Box called "ListBox1".

Warning Icon

Be consistent with uppercase and lowercase letter when you attach a control to an object variable.


ஏற்றுகிற உரையாடல்களுக்கான உலகமைய செயலாற்றி


Function LoadDialog(Libname as String, DialogName as String, Optional oLibContainer)
Dim oLib as Object ' com.sun.star.script.XLibraryContainer
Dim oLibDialog as Object
Dim oRuntimeDialog as Object
    If IsMissing(oLibContainer) Then
        oLibContainer = DialogLibraries
    End If
    oLibContainer.LoadLibrary(LibName)
    oLib = oLibContainer.GetByName(Libname)
    oLibDialog = oLib.GetByName(DialogName)
    oRuntimeDialog = CreateUnoDialog(oLibDialog)
    LoadDialog() = oRuntimeDialog
End Function

LoadDialog function is stored in Tools.ModuleControls available from LibreOffice Macros and Dialogs.

ஓர் உரையாடலைக் காட்சியளித்தல்


மாறிகளின் REM உலகமைய வரையறை
Dim oDialog1 AS Object
Sub StartDialog1
    With GlobalScope.BasicLibraries
       If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")
    End With
    oDialog1 = Tools.ModuleControls.LoadDialog("Standard", "Dialog1")
    oDialog1.Execute()
End Sub

நிரலியிலுள்ள கட்டுப்பாடுகளின் பண்புகளை வாசி அல்லது தொகு


Sub Sample1
    With GlobalScope.Basiclibraries
       If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")
    End With
    oDialog1 = Tools.LoadDialog("Standard", "Dialog1")
    REM உரையாடல் ஒப்புருவைப் பெறு
    oDialog1Model = oDialog1.Model
    REM Label1-இன் உரையைக் காண்பி
    oLabel1 = oDialog1.GetControl("Label1")
    MsgBox oLabel1.Text
    REM கட்டுப்பாடு Label1-க்கான புதிய உரையை அமை
    oLabel1.Text = "புதிய கோப்புகள்"
    CheckBox1 கட்டுப்பாடுக்கான REM காட்சி ஒப்புரு பண்புகள்
    oCheckBox1Model = oDialog1Model.CheckBox1
    MsgBox oCheckBox1Model.Dbg_Properties
    கட்டுப்பாட்டு ஒப்புருக்கான தெரிவுப்பெட்டி1க்கான புதிய நிலையை REM  அமைக்கும்
    oCheckBox1Model.State = 1
    கட்டுப்பாடு கட்டளை பொத்தான்1 க்கான ஒப்புரு பண்புகளைக் REM காட்டும்
    oCMD1Model = oDialog1Model.CommandButton1
    MsgBox oCMD1Model.Dbg_Properties
    கட்டுப்பாடு கட்டளை பொத்தான்1 இன் பண்புகளை REM காட்டும்
    oCMD1 = oDialog1.GetControl("CommandButton1")
    MsgBox oCMD1.Dbg_Properties
    REM உரையாடலை நிறைவேற்று
    oDialog1.Execute()
End Sub

பட்டியல்பெட்டியில் ஒரு உள்ளீடைச் சேர்க


Sub AddEntry
    With GlobalScope.Basiclibraries
       If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")
    End With
    oDialog1 = ModuleControls.LoadDialog("Standard", "Dialog1")
    REM ஒரு புதிய உள்ளீட்டை ListBox-இல் சேர்க்கிறது
    oDialog1Model = oDialog1.Model
    oListBox = oDialog1.GetControl("ListBox1")
    Dim iCount as integer
    iCount = oListbox.ItemCount
    oListbox.additem("New Item" & iCount,0)
End Sub

ஒரு பட்டியல் பெட்டியிலிருந்து ஒரு உள்ளீட்டை அகற்று.


Sub RemoveEntry
    With GlobalScope.Basiclibraries
       If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")
    End With
    oDialog1 = Tools.ModuleControls.LoadDialogLoadDialog("Standard", "Dialog1")
    REM பட்டியல் பெட்டியில் உள்ள முதல் உள்ளீட்டினை அகற்றும்
    oDialog1Model = oDialog1.Model
    oListBox = oDialog1.GetControl("ListBox1")
    oListbox.removeitems(0,1)
End Sub

Please support us!