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

2013-07-04 Thread 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.

From c50eb6800e90009e8268703353ee2ad5e5edb000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= caol...@redhat.com
Date: Thu, 4 Jul 2013 13:19:09 +0100
Subject: [PATCH] make ui-enabled backing window set layout allocation

Change-Id: I909d034ef23730f6a888b02ed1ec0c132cb105fb
---
 framework/source/services/backingwindow.cxx | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index a5144d4..6e6d2c9 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -613,6 +613,8 @@ void BackingWindow::setOwningFrame( const com::sun::star::uno::Reference com::s
 
 void BackingWindow::Resize()
 {
+if (isLayoutEnabled(this))
+VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD), Point(0, 0), GetOutputSizePixel());
 //maToolbox.calcMinSize();
 /*
 Size aTBSize( maToolbox.getMinSize() );
-- 
1.8.3.1

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2013-07-04 Thread Krisztian Pinter
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 caol...@redhat.com 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
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2013-07-03 Thread Krisztian Pinter
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 efeyala...@gmail.com 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
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2013-07-02 Thread Krisztian Pinter
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
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2013-07-02 Thread Efe Gürkan YALAMAN
2013/7/2 Krisztian Pinter pin.termina...@gmail.com

 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
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2013-07-02 Thread Efe Gürkan YALAMAN
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
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice