OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Multi page dialogs -- DocConverter

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Mon Feb 09, 2004 3:00 pm    Post subject: Multi page dialogs -- DocConverter Reply with quote

This thread continued from.....
http://www.oooforum.org/forum/viewtopic.php?p=21195#21195


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.....
Code:
'------------------------------------------------------------
' 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.
http://www.oooforum.org/forum/viewtopic.php?p=10311#10311
http://www.oooforum.org/forum/viewtopic.php?t=2810
http://www.oooforum.org/forum/viewtopic.php?t=3525
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?
Back to top
View user's profile Send private message
cayc0
Guest





PostPosted: Tue Feb 10, 2004 1:50 am    Post subject: Reply with quote

For the first problem. Thank you for your very accurate description on how to do the trick Wink It helped - my problem was that I was selecting whole frame with elements in it; I should select a frame by clicking on its border. Thanks one again!

The second problem. It was that OOorg crashed on your original script while closing DocConverter-2003-10-26-05.sxd. Steps to reproduce the bug:
- download and install polish OOorg from http://www.ux.pl/ - I haven't try with original OOorg
- download and unpack DocConverter
- open DocConverter and try to close it
It will crash with unrecoverable error.

Also it sometimes crashes while running - mostly when you run it for the first time. When run second or third time it ussualy works - although it still crashes on window close.

You can reproduce this bug on Windows and Linux - I haven't try other OS.

The problem's gone on English version of OOorg - I checket it this morning.

My questions are why does it happen and how can I help to fix it?

bye

cayco
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group