[yast-commit] r39314 - in /branches/tmp/sh/mod-ui/ncurses/src: NCCheckBoxFrame.cc NCCheckBoxFrame.h
![](https://seccdn.libravatar.org/avatar/9d45ad4c714db4d170a42527a4a6b8dc.jpg?s=120&d=mm&r=g)
Author: gs Date: Wed Jul 11 11:50:08 2007 New Revision: 39314 URL: http://svn.opensuse.org/viewcvs/yast?rev=39314&view=rev Log: add preferredWidth/Height Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc?rev=39314&r1=39313&r2=39314&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc Wed Jul 11 11:50:08 2007 @@ -87,6 +87,24 @@ return dim == YD_HORIZ ? defsze.W : defsze.H; } +int NCCheckBoxFrame::preferredWidth() +{ + defsze.W = firstChild()->preferredWidth(); + + if ( label.width() > (unsigned)defsze.W ) + defsze.W = label.width(); + defsze.W += framedim.Sze.W + 4; // add space for checkbox + + return defsze.W; +} + +int NCCheckBoxFrame::preferredHeight() +{ + defsze.H = firstChild()->preferredHeight() + framedim.Sze.H; + + return defsze.H; +} + /////////////////////////////////////////////////////////////////// // // Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h?rev=39314&r1=39313&r2=39314&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h Wed Jul 11 11:50:08 2007 @@ -61,6 +61,8 @@ virtual long nicesize( YUIDimension dim ); + virtual int preferredWidth(); + virtual int preferredHeight(); /** * Set the new size of the widget. * -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
gs@svn.opensuse.org