Difference between revisions of "Documentation/DevGuide/GUI/Progress Bar"
(Initial author Sun Microsystems, Inc.) |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
|NextPage=Documentation/DevGuide/GUI/Horizontal Vertical Line Control | |NextPage=Documentation/DevGuide/GUI/Horizontal Vertical Line Control | ||
}} | }} | ||
− | {{DISPLAYTITLE:Progress Bar}} | + | {{Documentation/DevGuideLanguages|Documentation/DevGuide/GUI/{{SUBPAGENAME}}}} |
− | The progress bar control <idl>com.sun.star.awt.UnoControlProgressBar</idl> displays a growing or shrinking bar to give the user feedback during a persisting task. The minimum and the maximum progress value of the control is set by the <code>ProgressValueMin</code> and the <code>ProgressValueMax</code> properties of the control model that supports the service <idl>com.sun.star.awt.UnoControlProgressBarModel</idl> . The progress value is controlled by the <code>ProgressValue</code> property. The fill color can be changed by setting the property <code>FillColor</code>. The control implements the interface <idl>com.sun.star.awt.XProgressBar</idl> which allows you to control the progress bar. The progress bar interface <idl>com.sun.star.awt.XReschedule</idl> helps to update and repaint the progress bar while a concurrent task is running, but this interface interrupts the main thread of the office. Issue | + | {{DISPLAYTITLE:Progress Bar}} |
− | + | The progress bar control <idl>com.sun.star.awt.UnoControlProgressBar</idl> displays a growing or shrinking bar to give the user feedback during a persisting task. The minimum and the maximum progress value of the control is set by the <code>ProgressValueMin</code> and the <code>ProgressValueMax</code> properties of the control model that supports the service <idl>com.sun.star.awt.UnoControlProgressBarModel</idl> . The progress value is controlled by the <code>ProgressValue</code> property. The fill color can be changed by setting the property <code>FillColor</code>. The control implements the interface <idl>com.sun.star.awt.XProgressBar</idl> which allows you to control the progress bar. The progress bar interface <idl>com.sun.star.awt.XReschedule</idl> helps to update and repaint the progress bar while a concurrent task is running, but this interface interrupts the main thread of the office. Issue https://www.openoffice.org/issues/show_bug.cgi?id=i71425 is assigned to find an appropriate solution for this problem. | |
+ | <syntaxhighlight lang="java"> | ||
public XPropertySet insertProgressBar(int _nPosX, int _nPosY, int _nWidth, int _nProgressMax){ | public XPropertySet insertProgressBar(int _nPosX, int _nPosY, int _nWidth, int _nProgressMax){ | ||
XPropertySet xPBModelPSet = null; | XPropertySet xPBModelPSet = null; | ||
Line 46: | Line 47: | ||
return xPBModelPSet; | return xPBModelPSet; | ||
} | } | ||
− | + | </syntaxhighlight> | |
{{PDL1}} | {{PDL1}} | ||
− | [[Category: Graphical User Interfaces]] | + | |
+ | [[Category:Documentation/Developer's Guide/Graphical User Interfaces]] |
Latest revision as of 12:45, 22 December 2020
- Common Properties
- Font-specific Properties
- Other Common Properties
- Property Propagation Between Model and Control
- Common Workflow to add Controls
- The Example Listings
- Label Field
- Command Button
- Image Control
- Check Box
- Radio Button
- Scroll Bar
- List Box
- Combo Box
- Progress Bar
- Horizontal/Vertical Line Control
- Group Box
- Text Field
- Text Field Extensions
- Formatted Field
- Numeric Field
- Currency Field
- Date Field
- Time Field
- Pattern Field
- Roadmap Control
- File Control
- File Picker
- Message Box
The progress bar control com.sun.star.awt.UnoControlProgressBar displays a growing or shrinking bar to give the user feedback during a persisting task. The minimum and the maximum progress value of the control is set by the ProgressValueMin
and the ProgressValueMax
properties of the control model that supports the service com.sun.star.awt.UnoControlProgressBarModel . The progress value is controlled by the ProgressValue
property. The fill color can be changed by setting the property FillColor
. The control implements the interface com.sun.star.awt.XProgressBar which allows you to control the progress bar. The progress bar interface com.sun.star.awt.XReschedule helps to update and repaint the progress bar while a concurrent task is running, but this interface interrupts the main thread of the office. Issue https://www.openoffice.org/issues/show_bug.cgi?id=i71425 is assigned to find an appropriate solution for this problem.
public XPropertySet insertProgressBar(int _nPosX, int _nPosY, int _nWidth, int _nProgressMax){ XPropertySet xPBModelPSet = null; try{ // create a unique name by means of an own implementation... String sName = createUniqueName(m_xDlgModelNameContainer, "ProgressBar"); // create a controlmodel at the multiservicefactory of the dialog model... Object oPBModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlProgressBarModel"); XMultiPropertySet xPBModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oPBModel); // Set the properties at the model - keep in mind to pass the property names in alphabetical order! xPBModelMPSet.setPropertyValues( new String[] {"Height", "Name", "PositionX", "PositionY", "Width"}, new Object[] { new Integer(8), sName, new Integer(_nPosX), new Integer(_nPosY), new Integer(_nWidth)}); // The controlmodel is not really available until inserted to the Dialog container m_xDlgModelNameContainer.insertByName(sName, oPBModel); xPBModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oPBModel); // The following properties may also be set with XMultiPropertySet but we // use the XPropertySet interface merely for reasons of demonstration xPBModelPSet.setPropertyValue("ProgressValueMin", new Integer(0)); xPBModelPSet.setPropertyValue("ProgressValueMax", new Integer(_nProgressMax)); }catch (com.sun.star.uno.Exception ex){ /* perform individual exception handling here. * Possible exception types are: * com.sun.star.lang.IllegalArgumentException, * com.sun.star.lang.WrappedTargetException, * com.sun.star.container.ElementExistException, * com.sun.star.beans.PropertyVetoException, * com.sun.star.beans.UnknownPropertyException, * com.sun.star.uno.Exception */ ex.printStackTrace(System.out); } return xPBModelPSet; }
Content on this page is licensed under the Public Documentation License (PDL). |