Ismael's blogtag:lebasket.free.fr,2024:/blog/index.php2007-08-29T14:27:50+02:00DotCleardaily12007-08-29T14:27:50+02:00GSOC: ListViews (Part 2)2007-08-29T14:27:50+02:00tag:lebasket.free.fr,2007-08-29:/blog/26ismaelAnother 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.... <p>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 <strong>ALL platforms</strong> which support native controls (MacOS but also Linux, Windows....). These old style controls are mainly visible in the Options dialog.</p>
<p>Screenshots (on MacOS X):
<br />
<img src="/blog/images/listviews/listViewBtnOLD.png" alt="" /> <img src="/blog/images/listviews/listViewBtnAqua.png" alt="" />
<br /></p>
<p>The code has been committed to aquavcl03.</p>GSOC: ListViews (Part 1)2007-08-24T11:51:57+02:00tag:lebasket.free.fr,2007-08-24:/blog/25ismaelNow 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... <p>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.</p>
<p>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: <em>nodes and nets</em>.</p>
<p>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.</p>
<p>I added calls to native drawing functions in svtools, and the corresponding code in native part of vcl.</p>
<p>As usual, some screenshots (Aqua look on the right):</p>
<p><img src="/blog/images/listviews/listNodesOldPrefs.png" alt="" /> <img src="/blog/images/listviews/listNodesAquaPrefs.png" alt="" /><br />
<em>Preferences/option dialog</em>
<br /></p>
<p><img src="/blog/images/listviews/listNodesOldBibli.png" alt="" /> <img src="/blog/images/listviews/listNodesAquaBibli.png" alt="" /><br />
<em>Bibliography panel</em></p>GSOC: New progress (bar) ;-)2007-08-20T14:10:06+02:00tag:lebasket.free.fr,2007-08-20:/blog/24ismaelThe 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... <p><img src="/blog/images/splashScreenAqua.png" alt="" style="display:block; margin:0 auto;" />
<br /></p>
<p>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</p>
<p>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.
<br /></p>
<p><em>There's more to come, stay tuned</em> ;-)</p>GSOC: native check and radio marks for menus2007-07-18T22:10:44+02:00tag:lebasket.free.fr,2007-07-18:/blog/23ismaelToday, 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 ;-)... <p>Today, after some search on the Apple Developer mailing-lists, I implemented the drawing of native check marks and radio marks for menus.</p>
<p>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 ;-)</p>
<p><img src="/blog/images/MenuMarks/checkMarkVCL3.png" alt="" /> <img src="/blog/images/MenuMarks/checkMarkAqua3.png" alt="" /><br />
<img src="/blog/images/MenuMarks/radioMarkVCL2.png" alt="" /> <img src="/blog/images/MenuMarks/radioMarkAqua2.png" alt="" /></p>
<p>This code has been committed to aquavcl02</p>GSOC: non-native border2007-07-16T18:25:22+02:00tag:lebasket.free.fr,2007-07-16:/blog/22ismaelMany 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... <p>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.</p>
<p>Some screenshots now (on the left, VCL borders; on the right, aqua borders):</p>
<p><img src="/blog/images/decoBorders/borderSelectVCL.png" alt="" /> <img src="/blog/images/decoBorders/borderSelectAqua.png" alt="" /><br />
Not all 3D borders are drawn natively yet, as they may be drawn in some other part of VCL.</p>
<p><img src="/blog/images/decoBorders/colorVCL.png" alt="" /> <img src="/blog/images/decoBorders/colorAqua.png" alt="" /></p>
<p><img src="/blog/images/decoBorders/formulaVCL.png" alt="" /> <img src="/blog/images/decoBorders/formulaAqua.png" alt="" /></p>
<p>Contextual menus have no more 3D borders:</p>
<p><img src="/blog/images/decoBorders/menuVCL.png" alt="" /> <img src="/blog/images/decoBorders/menuAqua.png" alt="" /></p>
<p>But, this patch still needs some work, because it makes dropdown listboxes strange; see:</p>
<p><img src="http://lebasket.free.fr/OOo/16_07_07/dropdownBug.png" alt="" /><br />
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.</p>
<p>Finally, the link to the patch:
<a href="http://lebasket.free.fr/OOo/16_07_07/patchNativeBorder.diff" hreflang="en">http://lebasket.free.fr/OOo/16_07_07/patchNativeBorder.diff</a></p>
<p><br />
<strong>Update:</strong> 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</p>GSOC: TextEdits, SpinBoxes,...2007-07-09T17:28:15+02:00tag:lebasket.free.fr,2007-07-09:/blog/21ismaelI 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.... <p>I continued my GSOC by implementing some other aqua controls for the macport:</p>
<ul>
<li>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):</li>
</ul>
<p><img src="/blog/images/textEditVCL.png" alt="" /> <img src="/blog/images/aquaTextEdit.png" alt="" /></p>
<p><img src="/blog/images/multlineEditVCL.png" alt="" /> <img src="/blog/images/aquaMultiLineEdit.png" alt="" /></p>
<ul>
<li>Non-dropdown listboxes are also drawn natively.</li>
</ul>
<p><img src="/blog/images/classicListBoxVCL2.png" alt="" /> <img src="/blog/images/classicListBoxAqua2.png" alt="" /></p>
<ul>
<li>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 (<em>const ImplControlValue& aValue</em>) of drawNativeControl(). Indeed, the optional value (<em>aValue.getOptionalVal()</em>) which is needed to know the state of the spinbuttons was sometimes null and reading the state (<em>pSpinButtonVal->mnUpperState</em>) was the cause of the crash. Now, the pointer value is tested to avoid crashes (<em>if(pSpinButtonVal)</em>)</li>
</ul>
<p><img src="/blog/images/spinboxVCL.png" alt="" /> <img src="/blog/images/spinBoxAqua.png" alt="" />
<br /></p>
<p>All these changes have been committed to aquavcl02.</p>GSOC: Focus tabs and bold text2007-07-03T14:20:25+02:00tag:lebasket.free.fr,2007-07-03:/blog/20ismaelOn 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 (... <p>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 ( <a href="http://developer.gnome.org/projects/gup/hig/2.0/controls-notebooks.html" hreflang="en">http://developer.gnome.org/projects/gup/hig/2.0/controls-notebooks.html </a> ). 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.</p>
<p>The patch is <a href="http://lebasket.free.fr/OOo/03_07_07/patchNoBoldTab.diff" hreflang="en">here</a><br /></p>
<p><strong>Update:</strong> patch committed to aquavcl02</p>GSOC: Aqua Dropdown Listboxes2007-07-02T18:00:50+02:00tag:lebasket.free.fr,2007-07-02:/blog/19ismaelThese 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... <p>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.<br /></p>
<p><em>Old style of listbox:</em> <br /><img src="/blog/images/ListBoxOld.png" alt="" /><br /> <br />
<em>New style of listbox (without and with scroll symbols):</em> <br /><img src="/blog/images/listBoxNew.png" alt="" /> <img src="/blog/images/listBoxNewScroll.png" alt="" />
<br /><br /></p>
<p>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.<br />
<img src="/blog/images/listBoxPaintBug.png" alt="" /></p>
<p>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.</p>
<p>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.</p>
<p><br />
<em>Correct drop down listbox (image from the Apple Human Interface Guidelines):</em><br />
<img src="http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/art/ct_popmenupopped.gif" alt="" /><br />
<br /></p>
<p>I'll continue my work these next days to have a more stable and feature complete listbox control.</p>
<p>The patch is here: <a href="http://lebasket.free.fr/OOo/02_07_07/patchListBox.diff" hreflang="en">http://lebasket.free.fr/OOo/02_07_07/patchListBox.diff</a></p>GSOC: tabs improved, other controls started2007-06-20T22:26:47+02:00tag:lebasket.free.fr,2007-06-20:/blog/18ismaelA 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... <p>A debate started (<a href="http://ux.openoffice.org/servlets/ReadMsg?list=discuss&msgNo=337" hreflang="en">the starting mail</a>) 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.
<br />
<img src="/blog/images/tabListBoxLittle.png" alt="" /><br />
<br /></p>
<p>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.<br />
<img src="/blog/images/listbox.png" alt="" /><br />
<em>Example of a listbox and a text edit</em><br />
<br /></p>GSOC: two styles of tabs2007-06-12T11:47:51+02:00tag:lebasket.free.fr,2007-06-12:/blog/17ismaelI 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... <p>I fixed the bug i mentioned in the previous post. Now there is no more space between two lines of tabs.<br />
<img src="/blog/images/tabsOOo2mini.png" alt="" style="display:block; margin:0 auto;" /></p>
<p><br />
But the tabs hadn't the newest look. <br />
<img src="http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/art/ct_standard_tabs.gif" alt="" /> <br /><em>Image from the AHIG</em></p>
<p>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.</p>
<p>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.</p>
<p>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.
<br />
<img src="/blog/images/tabsNewLook.png" alt="" style="display:block; margin:0 auto;" />
<br /></p>
<p>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:
<img src="/blog/images/tabsOnTwoLines.png" alt="" style="display:block; margin:0 auto;" /></p>
<p>So i don't know yet which style of tabs is most adapted to OOo.</p>
<p><a href="http://lebasket.free.fr/OOo/11_06_07/patchTwoStylesOfTabs.diff" hreflang="en">The patch</a> (which contains also a bugfix to prevent AquaSalGraphics::hitTestNativeControl from crashing)<br />
To have the old style of tabs just uncomment //#define OLD_TAB_STYLE</p>