Ismael's blog

Aller au contenu | Aller au menu | Aller à la recherche

Wednesday 29 August 2007

GSOC: ListViews (Part 2)

Another thing I did in listviews, was to replace the old chekboxes and radio buttons by native ones if the platform supports them. This issue concerned ALL platforms which support native controls (MacOS but also Linux, Windows....). These old style controls are mainly visible in the Options dialog.

Screenshots (on MacOS X):

The code has been committed to aquavcl03.

Friday 24 August 2007

GSOC: ListViews (Part 1)

Now almost all controls are native on OOo on Mac. But some have still the old Windows style: list views with their sub controls were part of them. I investigated and looked everywhere in VCL, but I didn't find any trace of listviews nor headbar (of listviews) nor nodes... In fact, I couldn't find them there. Philipp Lohmann told me that these controls are in the svtools module. Later, Herbert Duerr explained me that more complex controls are implemented in this module, but the border between these two modules is vague as some controls in svtools could be in vcl and vice versa.

Once the good module found, it was not so difficult to add support for native controls in listviews. The one I will talk about in this post, is the first I committed (to aquavcl03). In fact, this one is two controls: nodes and nets.

A node is a little square with a plus or a minus in it (on MacOS it's a triangle directed to bottom or right) according to whether the list item is collapsed or not. The net is the line which link up hierarchical list view items by their nodes.

I added calls to native drawing functions in svtools, and the corresponding code in native part of vcl.

As usual, some screenshots (Aqua look on the right):


Preferences/option dialog


Bibliography panel

Monday 20 August 2007

GSOC: New progress (bar) ;-)


The blue rectangle used as progress bar in the splash screen didn't suit well on the MacOS platform. So after some investigations, i added the support for native progress bar in the splash screen. The flag for the control is different from the one defined for progress bars used in the application (CTRL_PROGRESS), so that platforms who want to use the OOo's progress bar for splash screen but native progress bars in the application can. Therefore, I added the flag CTRL_INTROPROGRESS in salnativewidgets.hxx

As the module desktop (where code for splashscreen is located) is necessary, I added it to the CWS aquavcl03, and so I learned how to do common tasks to CWS (other than committing of course). I have also committed the code to aquavcl03.

There's more to come, stay tuned ;-)

Wednesday 18 July 2007

GSOC: native check and radio marks for menus

Today, after some search on the Apple Developer mailing-lists, I implemented the drawing of native check marks and radio marks for menus.

So here are the usual screenshots (check marks on the top; radio marks on the bottom); I let you guess which are VCL style and which are aqua style ;-)


This code has been committed to aquavcl02

Monday 16 July 2007

GSOC: non-native border

Many controls are now aqua but some win32 style borders were still visible. After some investigations, I found that many borders were drawn in the platform independent part of VCL without any call to drawNativeControl() or getNativeControlRegion(), in vcl/source/window/decoview.cxx. So I added these call and the corresponding code in the native part of VCL. I also added new flags to salnativewidgets.hxx: CTRL_FRAME and PART_BORDER. Now VCL call native functions to draw borders, if the native functions can't draw them (return false), the platform independent part of VCL draws them like it did before my patch.

Some screenshots now (on the left, VCL borders; on the right, aqua borders):


Not all 3D borders are drawn natively yet, as they may be drawn in some other part of VCL.

Contextual menus have no more 3D borders:

But, this patch still needs some work, because it makes dropdown listboxes strange; see:


Another bug, is that there's a black pixel on the top right corner and another one on the bottom left corner of some frames.

Finally, the link to the patch: http://lebasket.free.fr/OOo/16_07_07/patchNativeBorder.diff


Update: the bug concerning listboxes has been fixed thanks to the help of my mentor Eric Bachard and so the code has been committed to aquavcl02

Monday 9 July 2007

GSOC: TextEdits, SpinBoxes,...

I continued my GSOC by implementing some other aqua controls for the macport:

  • TextEdits and MultiLine Edits: I replaced the old style of frame by the aqua one. The focus rect isn't drawn yet. (Old style on the left, aqua on the right):

  • Non-dropdown listboxes are also drawn natively.

  • Spinboxes have also native style, both text field and spin buttons. I continued the work of Eric Bachard who started the implementation of the spin buttons. We both faced crashs because of the SpinButtonValue passed as argument (const ImplControlValue& aValue) of drawNativeControl(). Indeed, the optional value (aValue.getOptionalVal()) which is needed to know the state of the spinbuttons was sometimes null and reading the state (pSpinButtonVal->mnUpperState) was the cause of the crash. Now, the pointer value is tested to avoid crashes (if(pSpinButtonVal))


All these changes have been committed to aquavcl02.

Tuesday 3 July 2007

GSOC: Focus tabs and bold text

On some platforms, the focused tab hasn't bold text. It's the case not only for MacOS X but also for Gnome and maybe for other platforms. For Gnome, i didn't know it until i received a mail from a gnome user who explained me the problem and gave me the link to the Gnome Human Interface Guidelines ( http://developer.gnome.org/projects/gup/hig/2.0/controls-notebooks.html ). The problem is that on VCL, this feature is in the platform independent part although it depends on the platform. So I added a variable to the ImplSVNWFData structure in vcl/inc/vcl/svdata.hxx to choose whether selected tab has bold text or not. I also modified vcl/source/control/tabctrl.cxx to check this variable.

The patch is here

Update: patch committed to aquavcl02

Monday 2 July 2007

GSOC: Aqua Dropdown Listboxes

These last days I started to work on drop down listboxes. I implemented the drawing of the button some weeks ago, but listboxes hadn't an aqua look, the drawing of their frame didn't call the native functions. So, I looked at the platform independent part of VCL, and I created a new class of listbox windows, inspired by the floating menu class, and helped by advice of Philipp Lohmann. I added two variables to the ImplSVNWFData structure (svdata.hxx) to chose which listbox window should be used, and if it has scrollbars or scroll symbols like popup menus.

Old style of listbox:


New style of listbox (without and with scroll symbols):


But some bugs still exist, and some features have still to be implemented. For example, there's sometimes a drawing bug (which concerns only listboxes with scroll symbols): some entries and the scroll symbols are not drawn.

Another bug appears when the user clicks the listbox, if the mouse pointer is not in the region of the popup window, this popup window disappears.

Concerning missing features, the checkmark for the selected item is not yet implemented. And when the mouse is over the scroll symbols, the window doesn't scroll yet.


Correct drop down listbox (image from the Apple Human Interface Guidelines):


I'll continue my work these next days to have a more stable and feature complete listbox control.

The patch is here: http://lebasket.free.fr/OOo/02_07_07/patchListBox.diff

Wednesday 20 June 2007

GSOC: tabs improved, other controls started

A debate started (the starting mail) on mac@porting and discuss@ux mailing lists concerning tabs in OOo after I wrote my previous post. Indeed, on Mac OS X, there can't be several lines of tabs, and when it's the case, a popup-menu (named listbox in OOo) is used instead. So I started to modify the general implementation of tabs in VCL. At that time, the result is very unstable and really experimental, but i have a better Mac OS X behaviour for tabs: when there is only one line: normal tabs are used; when there are more than one line, a listbox is used instead.


I also worked on drawing some native controls like text edits or list boxes. For the firsts, i still have some problems: the background is transparent (so grey as windows have grey backgrounds), and the focus rect is not drawn. I have to look at it. Concerning the second, listboxes, the button is correct, but the frame is not yet vertically centered as it should be in Mac OS X.

Example of a listbox and a text edit

Tuesday 12 June 2007

GSOC: two styles of tabs

I fixed the bug i mentioned in the previous post. Now there is no more space between two lines of tabs.


But the tabs hadn't the newest look.

Image from the AHIG

So I investigated. Eric Bachard told me about some undocumented functions and flags to have tabs with MacOSX10.4 look. After some other and deeper investigations, i found how to have them.

I then modified some parts of the platform independent part of VCL to have tabs centered, and to have VCL which asks for the tab size to the native part of it by using getNativeControlRegion. I still have to remove bold text for focused tab which is in the platform independent part of VCL although it is a platform dependent behavior.

Now tabs are drawn correctly, behave normally, and respect fully the AHIG. Their normal height is 20 pixel and a space of 12 pixels is left between the text and the border.

But with this style of tabs, there's a problem. When there are too much tabs, two lines of tabs are drawn, and the result is a bit dirty:

So i don't know yet which style of tabs is most adapted to OOo.

The patch (which contains also a bugfix to prevent AquaSalGraphics::hitTestNativeControl from crashing)
To have the old style of tabs just uncomment //#define OLD_TAB_STYLE