create a new page, using OOoBasic/Dialog/Example26 as a template.
Front page
Search
掲示板
Reload
Help
Browse Log
掲示板の使い方
OOo 掲示板3
OOo 掲示板2
OOo 掲示板
掲示板
雑談掲示板
New
List of pages
Recent changes
Backup
簡単ヘルプ
整形ルール
Start:
* Exmple26 [#vdf0c27f]
サイズを変更できるモーダルダイアログ。
作成も管理も面倒なので仕方のないとき以外は使わない方がい...
#code(basic){{
Dim oDialog As Variant
Dim oCont As Variant
Sub CreateDialogTest10
oDoc = ThisComponent
oFrame = oDoc.getCurrentController().getFrame()
oContainerWindow = oFrame.getContainerWindow()
oToolkit = oContainerWindow.getToolkit()
WA = com.sun.star.awt.WindowAttribute
aRect = CreateUnoStruct("com.sun.star.awt.Rectangle")
aRect.Width = 200
aRect.Height = 200
oDesc = CreateUnoStruct("com.sun.star.awt.WindowDescrip...
With oDesc
.Type = com.sun.star.awt.WindowClass.SIMPLE
.WindowServiceName = "dialog"
.Parent = oContainerWindow
.ParentIndex = -1
.Bounds = aRect
.WindowAttributes = WA.CLOSEABLE OR WA.MOVEABLE OR WA...
End With
oDialog = oToolkit.createWindow(oDesc)
oDialog.addTopWindowListener(CreateUnoListener(_
"WindowListener_", "com.sun.star.awt.XTopWindowList...
oDialog.addWindowListener(CreateUnoListener(_
"WindowListener_", "com.sun.star.awt.XWindowListene...
oCont = CreateControlContainer(oDialog, 0, 0, 200, 200)
oEdit = CreateTextField(oCont, "edit", 0, 0, 200, 200, _
Array("MultiLine"), Array(True))
oDialog.setVisible(True)
'mri oDialog
n = oDialog.execute()
If n > 0 Then
End If
oDialog.dispose()
End Sub
Function CreateControlContainer(oParent, nX, nY, nWidth, ...
oCont = CreateUnoService("com.sun.star.awt.UnoControlCo...
oContModel = CreateUnoService("com.sun.star.awt.UnoCont...
oCont.setModel(oContModel)
oCont.createPeer(oParent.getToolkit(), oParent)
oCont.setPosSize(nX, nY, nWidth, nHeight, com.sun.star....
CreateControlContainer = oCont
End Function
Function CreateTextField(_
oContainer, sName, nX, nY, nWidth, nHeight, _
Optional sNames, Optional aValues)
oEdit = CreateUnoService("com.sun.star.awt.UnoControlEd...
oEditModel = CreateUnoService("com.sun.star.awt.UnoCont...
oEdit.setModel(oEditModel)
If NOT IsMissing(sNames) Then
oEditModel.setPropertyValues(sNames, aValues)
End If
oContainer.addControl(sName, oEdit)
oEdit.setPosSize(nX, nY, nWidth, nHeight, com.sun.star....
CreateTextField = oEdit
End Function
Sub WindowListener_disposing(ev)
End Sub
Sub WindowListener_windowOpened(ev)
End Sub
Sub WindowListener_windowClosing(ev)
oDialog.endExecute()
End Sub
Sub WindowListener_windowClosed(ev)
End Sub
Sub WindowListener_windowMinimized(ev)
End Sub
Sub WindowListener_windowNormalized(ev)
End Sub
Sub WindowListener_windowActivated(ev)
End Sub
Sub WindowListener_windowDeactivated(ev)
End Sub
Sub WindowListener_windowResized(ev)
aSize = ev.Source.getSize()
oCont.setPosSize(0, 0, aSize.Width, aSize.Height, com.s...
oEdit = oCont.getControl("edit")
oEdit.setPosSize(0, 0, aSize.Width, aSize.Height, com.s...
End Sub
Sub WindowListener_windowMoved(ev)
End Sub
Sub WindowListener_windowShown(ev)
End Sub
Sub WindowListener_windowHidden(ev)
End Sub
}}
End:
* Exmple26 [#vdf0c27f]
サイズを変更できるモーダルダイアログ。
作成も管理も面倒なので仕方のないとき以外は使わない方がい...
#code(basic){{
Dim oDialog As Variant
Dim oCont As Variant
Sub CreateDialogTest10
oDoc = ThisComponent
oFrame = oDoc.getCurrentController().getFrame()
oContainerWindow = oFrame.getContainerWindow()
oToolkit = oContainerWindow.getToolkit()
WA = com.sun.star.awt.WindowAttribute
aRect = CreateUnoStruct("com.sun.star.awt.Rectangle")
aRect.Width = 200
aRect.Height = 200
oDesc = CreateUnoStruct("com.sun.star.awt.WindowDescrip...
With oDesc
.Type = com.sun.star.awt.WindowClass.SIMPLE
.WindowServiceName = "dialog"
.Parent = oContainerWindow
.ParentIndex = -1
.Bounds = aRect
.WindowAttributes = WA.CLOSEABLE OR WA.MOVEABLE OR WA...
End With
oDialog = oToolkit.createWindow(oDesc)
oDialog.addTopWindowListener(CreateUnoListener(_
"WindowListener_", "com.sun.star.awt.XTopWindowList...
oDialog.addWindowListener(CreateUnoListener(_
"WindowListener_", "com.sun.star.awt.XWindowListene...
oCont = CreateControlContainer(oDialog, 0, 0, 200, 200)
oEdit = CreateTextField(oCont, "edit", 0, 0, 200, 200, _
Array("MultiLine"), Array(True))
oDialog.setVisible(True)
'mri oDialog
n = oDialog.execute()
If n > 0 Then
End If
oDialog.dispose()
End Sub
Function CreateControlContainer(oParent, nX, nY, nWidth, ...
oCont = CreateUnoService("com.sun.star.awt.UnoControlCo...
oContModel = CreateUnoService("com.sun.star.awt.UnoCont...
oCont.setModel(oContModel)
oCont.createPeer(oParent.getToolkit(), oParent)
oCont.setPosSize(nX, nY, nWidth, nHeight, com.sun.star....
CreateControlContainer = oCont
End Function
Function CreateTextField(_
oContainer, sName, nX, nY, nWidth, nHeight, _
Optional sNames, Optional aValues)
oEdit = CreateUnoService("com.sun.star.awt.UnoControlEd...
oEditModel = CreateUnoService("com.sun.star.awt.UnoCont...
oEdit.setModel(oEditModel)
If NOT IsMissing(sNames) Then
oEditModel.setPropertyValues(sNames, aValues)
End If
oContainer.addControl(sName, oEdit)
oEdit.setPosSize(nX, nY, nWidth, nHeight, com.sun.star....
CreateTextField = oEdit
End Function
Sub WindowListener_disposing(ev)
End Sub
Sub WindowListener_windowOpened(ev)
End Sub
Sub WindowListener_windowClosing(ev)
oDialog.endExecute()
End Sub
Sub WindowListener_windowClosed(ev)
End Sub
Sub WindowListener_windowMinimized(ev)
End Sub
Sub WindowListener_windowNormalized(ev)
End Sub
Sub WindowListener_windowActivated(ev)
End Sub
Sub WindowListener_windowDeactivated(ev)
End Sub
Sub WindowListener_windowResized(ev)
aSize = ev.Source.getSize()
oCont.setPosSize(0, 0, aSize.Width, aSize.Height, com.s...
oEdit = oCont.getControl("edit")
oEdit.setPosSize(0, 0, aSize.Width, aSize.Height, com.s...
End Sub
Sub WindowListener_windowMoved(ev)
End Sub
Sub WindowListener_windowShown(ev)
End Sub
Sub WindowListener_windowHidden(ev)
End Sub
}}
Page: