Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Undocumented and cumbersome css.ui.dialogs.ColorPicker | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | App Dev | Reporter: | Ariel Constenla-Haile <arielch> | ||||||||||||
Component: | api | Assignee: | AOO issues mailing list <issues> | ||||||||||||
Status: | ACCEPTED --- | QA Contact: | |||||||||||||
Severity: | Normal | ||||||||||||||
Priority: | P3 | CC: | issues, oooforum | ||||||||||||
Version: | 3.4.0 | ||||||||||||||
Target Milestone: | --- | ||||||||||||||
Hardware: | All | ||||||||||||||
OS: | All | ||||||||||||||
Issue Type: | DEFECT | Latest Confirmation in: | 4.0.1 | ||||||||||||
Developer Difficulty: | --- | ||||||||||||||
Attachments: |
|
Description
Ariel Constenla-Haile
2013-10-22 11:06:02 UTC
Created attachment 81806 [details]
ColorPicker service draft
Created attachment 81807 [details]
XColorPicker interface draft
Created attachment 81808 [details]
Sample AOO Basic code
Maybe it would be nice to add this in API documentation: http://www.openoffice.org/api/docs/common/ref/com/sun/star/ui/dialogs/module-ix.html (In reply to oooforum from comment #4) > Maybe it would be nice to add this in API documentation: > http://www.openoffice.org/api/docs/common/ref/com/sun/star/ui/dialogs/module- > ix.html I've changed a bit the IDL, because it was exposing some internal implementation details (namely, the preview control displaying the original color). Created attachment 82073 [details]
ColorPicker service, second draft
Created attachment 82074 [details]
XColorPicker interface, second draft
The second draft hides the dialog's implementation details by using two interfaces: css::ui::dialogs::XControlInformation; css::ui::dialogs::XControlAccess; Showing a color picker, displaying the original color, can be done with the following Basic code: Sub ColorPicker_PreviousColor Dim oWin as Object oWin = ThisComponent.getCurrentController().getFrame().getContainerWindow() Dim oDlg oDlg = com.sun.star.ui.dialogs.ColorPicker.create(oWin, RGB(255,0,0)) oDlg.setTitle("Color Picker Demo") oDlg.setControlProperty("PreviousColor","Visible",True) Dim nResult% nResult = oDlg.execute() If nResult = com.sun.star.ui.dialogs.ExecutableDialogResults.OK Then Dim nColor as Long nColor = oDlg.SelectedColor MsgBox "Selected color: RGB(" & _ CStr(Red(nColor)) & "," & _ CStr(Green(nColor)) & "," & _ CStr(Blue(nColor)) & ")" End If End Sub Instead of using strings ("PreviousColor","Visible"), it would be better to use constants, like the FilePicker does (XFilePickerControlAccess with CommonFilePickerElementIds, ExtendedFilePickerElementIds). But for now the color picker only exposes one control (original color preview) with one property (visible). Reset the assignee to the default "issues@openoffice.apache.org". |