[GSOC]Use Widget Layout for the Start Center Weekly Update 02

classic Classic list List threaded Threaded
7 messages Options
Krisztian Pinter Krisztian Pinter
Reply | Threaded
Open this post in threaded view
|

[GSOC]Use Widget Layout for the Start Center Weekly Update 02

Hi all!

Last week I have:

- Been busy with my final exam, so I had less time for GSoC. Thankfully, I passed.
- Been trying to figure out why nothing gets drawn after changing the buttons to .ui buttons.
Currently BackingWindow inherits from Window and VclBuilderContainer, and everything else is done like how the wiki page about .ui conversion says. (https://wiki.documentfoundation.org/Development/WidgetLayout)

I got rid of all the manual formatting code, then put it back, then removed it again, I cleaned the code to the bare bones, and all I managed to achieve is that the window is now drawn in white instead of light grey. Kendy suggested that maybe it's because I haven't redefined GetOptimalSize but adding it didn't seem to help.
I printed the position/size of the gui elements from the loaded .ui file, and both of them were (0,0) for all of them. I thought this was an error but I got similar results for other .uis that are drawn correctly.

I plan on looking more at Dialog and TabPage to figure out what is it exactly what I'm not doing that makes things draw. (It's probably magic and pixie dust.)

In my last report I mentioned that the dtor for Window gets called twice, I'm not sure about this anymore, it might be something that happens because the conversion to .ui is only partial and there are resource based bits in there. I want to focus on getting the .ui buttons to work right, and see if this problem sorts itself out.

If anyone has suggestions to what I'm missing I'd be very interested to hear them!

All the best,
Krisztian

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Efe Gürkan YALAMAN Efe Gürkan YALAMAN
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC]Use Widget Layout for the Start Center Weekly Update 02



2013/7/2 Krisztian Pinter <[hidden email]>
Hi all!
Hi,
 

I got rid of all the manual formatting code, then put it back, then removed it again, I cleaned the code to the bare bones, and all I managed to achieve is that the window is now drawn in white instead of light grey. Kendy suggested that maybe it's because I haven't redefined GetOptimalSize but adding it didn't seem to help.
I printed the position/size of the gui elements from the loaded .ui file, and both of them were (0,0) for all of them. I thought this was an error but I got similar results for other .uis that are drawn correctly.

 
I am currently dealing with the same problem on my project. I recognized something today which might be related to this. I am trying to draw a new SfxTabPage to the options dialog, but there is a blank light grey page instead of widgets. Here:

http://opengrok.libreoffice.org/xref/core/cui/source/options/treeopt.cxx#1116

Other tab pages which are drawn normally gets in there. But my page doesn't get in there. Inside of the isLayoutEnabled, isContainerWindow() returns false.

http://opengrok.libreoffice.org/xref/core/vcl/source/window/layout.cxx#2031

I think this might be also related to your problem.

Best,

--
Efe Gürkan YALAMAN
http://about.me/efegurkan

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Efe Gürkan YALAMAN Efe Gürkan YALAMAN
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC]Use Widget Layout for the Start Center Weekly Update 02

Hi,

I solved my problem. I hope it helps you too.

The layout thing I mentioned before is related to ui file. If ui file contains a toplevel it returns false. I cleaned toplevels and it returns true now. It is probably not related to your problem.

So I figured out on other ui files almost everything has visible option setted "True". I changed mine that way and checked with ui-previewer. Problem is gone now.

Hope it helps.

Cheers.

--
Efe Gürkan YALAMAN
http://about.me/efegurkan

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC]Use Widget Layout for the Start Center Weekly Update 02

On Wed, 2013-07-03 at 02:48 +0300, Efe Gürkan YALAMAN wrote:

> Hi,
>
> I solved my problem. I hope it helps you too.
>
> The layout thing I mentioned before is related to ui file. If ui file
> contains a toplevel it returns false. I cleaned toplevels and it
> returns true now. It is probably not related to your problem.
>
> So I figured out on other ui files almost everything has visible
> option setted "True". I changed mine that way and checked with
> ui-previewer. Problem is gone now.

Where are the two various pieces of code so I could take a look at this
for you ?

C.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Krisztian Pinter Krisztian Pinter
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC]Use Widget Layout for the Start Center Weekly Update 02

In reply to this post by Efe Gürkan YALAMAN
Hi,

Thank you for sharing this, I tried removing the toplevel, and checking the visibility option, but it didn't help, unfortunately.


I decided to take a different approach. I started again with the original source files which use resource files, and changed only one button to be dynamically allocated, so I call
mpWriterButton = new PushButton( this, STC_BUTTON_STYLE );
in the ctor of BackingWindow. The reason I tried this is because .ui buttons use pointers to buttons as well.
This causes a crash in Window::PreNotify(NotifyEvent&) when mpWriterButton is clicked, the other buttons work fine.

When I change the button to be a .ui button, and instead of the above I call this:
m_pUIBuilder = new VclBuilder(this, getUIRootDir(), "modules/StartModule/ui/startcenter.ui", "StartCenter");
get( mpWriterButton,    "writer");
it's not drawn, but it actually works; I can select it using the arrow keys, and when I press enter Writer starts. Since I left the manual formatting code for the buttons intact for now, I'd expect that to properly size and position this button, but it doesn't.


On 3 July 2013 01:48, Efe Gürkan YALAMAN <[hidden email]> wrote:
Hi,

I solved my problem. I hope it helps you too.

The layout thing I mentioned before is related to ui file. If ui file contains a toplevel it returns false. I cleaned toplevels and it returns true now. It is probably not related to your problem.

So I figured out on other ui files almost everything has visible option setted "True". I changed mine that way and checked with ui-previewer. Problem is gone now.

Hope it helps.

Cheers.


--
Efe Gürkan YALAMAN
http://about.me/efegurkan


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC]Use Widget Layout for the Start Center Weekly Update 02

In reply to this post by Caolán McNamara
On Thu, 2013-07-04 at 12:44 +0200, Krisztian Pinter wrote:

>
> And here are some patches where I maimed the code:
> https://gerrit.libreoffice.org/#/c/4502/
> https://gerrit.libreoffice.org/#/c/4605/

With those two applied locally, this additional attached patch will make
it work. Hope that helps.

C.


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

0001-make-ui-enabled-backing-window-set-layout-allocation.patch (1015 bytes) Download Attachment
Krisztian Pinter Krisztian Pinter
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC]Use Widget Layout for the Start Center Weekly Update 02

Yes, this helps a lot, thank you very much. I knew this was gonna turn out to be a "missing a line" type of problem. :)


On 4 July 2013 14:22, Caolán McNamara <[hidden email]> wrote:
On Thu, 2013-07-04 at 12:44 +0200, Krisztian Pinter wrote:

>
> And here are some patches where I maimed the code:
> https://gerrit.libreoffice.org/#/c/4502/
> https://gerrit.libreoffice.org/#/c/4605/

With those two applied locally, this additional attached patch will make
it work. Hope that helps.

C.



_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice