Joined: 02 Apr 2003
Location: Lawrence, Kansas, USA
|Posted: Mon Feb 09, 2004 3:00 pm Post subject: Multi page dialogs -- DocConverter
|This thread continued from.....
|cayc0 wrote: |
|I think there are some bugs in DocConverter.
First. Look at this screen-shot: http://cayco.studencka.pl/doc.jpg Can you see everything is plain wrong? This was made on original DocConverter code, in Basic IDE, opening DocConverterGUI tab, selecting frame and switching to page 1 in properties (Wlasciwosci in Polish). Other pages also look bad - I cannot make it useful. How can I edit it correctly?
I figured that someday someone would ask this question and I would have to answer it.
This will reveal a lot about how to build multi-page dialogs in OOo's IDE.
Click on the frame of the window. (So that it gets little green knobs around it.)
Now see the property sheet has a property (in English) called "Page (step)". it is the fourth property down, and is zero.
When this property is zero, then all controls of all pages allear together.
If you set this property to 1, then only controls on page 1 will appear. So how many pages are there, and what are their page numbers? See this code in DocConverter.....
' These are the pages of the dialog box.
' Click on the DocConverter_GUI tab in the Basic IDE.
' Select the frame of the dialog box.
' Right-click and display the property sheet.
' Change the Page (step) property to one of the numbers below,
' and then you can edit the gui for that page.
Const PAGE_FOLDERS = 1
Const PAGE_DOC_TYPE = 2
Const PAGE_READY_TO_BEGIN = 10
Const PAGE_DONE = 12
Const PAGE_INTERRUPTED = 13
Const PAGE_WRITER_SOURCE_TYPE = 71
Const PAGE_CALC_SOURCE_TYPE = 72
Const PAGE_IMPRESS_SOURCE_TYPE = 73
Const PAGE_DRAW_SOURCE_TYPE = 74
Const PAGE_WRITER_DEST_TYPE = 81
Const PAGE_CALC_DEST_TYPE = 82
Const PAGE_IMPRESS_DEST_TYPE = 83
Const PAGE_DRAW_DEST_TYPE = 84
There are 13 pages. While I could have put hidden controls in a secret page, such as 99, I didn't. One way you could find out everything is to go look at the XML that makes up this dialog box. (It is found within the document after you unzip it.)
When you put a new control onto the dialog box, BE SURE to assign the "Page (step)" property to the page number that the control should appear on. If a control is on page zero, then it always appears on ALL pages of the dialog box.
When you change the Page (step) property, you MUST have ONLY the dialog frame selected and NOT any controls! Otherwise, you are moving those controls to the new page. If I want to move a checkbox from page 5 to page 8, then...
1. Select frame of dialog box.
2. Set page property to 5.
3. Select checkbox, in addition to dialog frame.
4. Set page property to 8.
I now see page 8, and the checkbox is on page 8.
If you look at how the code works, it changes this property of the dialog box to cause different sets of controls to appear and disappear when you click Next, Next, Next, Finish.
If you are setting the page property, and seeing a messed up dialog, then I don't know what is wrong. It seems to work on my OOo 1.1.0 on Linux just fine.
The initial version of DocConverter was hastily written on a Saturday morning last September.
Later, in October, I added support for some additional filters. Because of its hasty development, and how little time I've put into it, it could very well have bugs. One user from Hungary was having trouble with it. So it might have problems on non-english OOo?
Hope this makes sense. Hope this information is useful to someone.
|cayc0 wrote: |
|Second. When I put your code in DocConverter it works but crashes all OOorg windows while clicking exit button. This is really annoying. Is there any way I can fix it? |
I have only used it on Windows a little. I wrote it on Linux, but did test it on Windows XP Pro briefly.
Want to make OOo Drawings like the colored flower design to the left?