[yast-commit] r41963 - in /branches/tmp/sh/mod-ui/ncurses/src: NCPopupInfo.cc NCPopupInfo.h
Author: gs Date: Mon Nov 12 11:21:37 2007 New Revision: 41963 URL: http://svn.opensuse.org/viewcvs/yast?rev=41963&view=rev Log: add preferredW/H Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.h Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc?rev=41963&r1=41962&r2=41963&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc Mon Nov 12 11:21:37 2007 @@ -167,16 +167,7 @@ closeDialog(); visible = false; } - -/////////////////////////////////////////////////////////////////// -// -// -// METHOD NAME : NCPopupInfo::niceSize -// METHOD TYPE : void -// -// DESCRIPTION : -// - +#if 0 long NCPopupInfo::nicesize(YUIDimension dim) { long vertDim = vDim; @@ -188,6 +179,41 @@ horDim = NCurses::cols()-10; return ( dim == YD_HORIZ ? horDim : vertDim ); } +#endif +/////////////////////////////////////////////////////////////////// +// +// +// METHOD NAME : NCPopupInfo::preferredWidth +// METHOD TYPE : int +// +// DESCRIPTION : returns preferred horizontal size +// +int NCPopupInfo::preferredWidth() +{ + int horDim = hDim; + + if ( hDim >= NCurses::cols() ) + horDim = NCurses::cols()-10; + + return horDim; +} + +/////////////////////////////////////////////////////////////////// +// +// +// METHOD NAME : NCPopupInfo::preferredHeight +// METHOD TYPE : int +// +// DESCRIPTION : returns preferred vertical size +// +int NCPopupInfo::preferredHeight() +{ + int vertDim = vDim; + if ( vDim >= NCurses::lines() ) + vertDim = NCurses::lines()-5; + + return vertDim; +} /////////////////////////////////////////////////////////////////// // Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.h?rev=41963&r1=41962&r2=41963&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.h (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.h Mon Nov 12 11:21:37 2007 @@ -77,8 +77,9 @@ virtual ~NCPopupInfo(); - virtual long nicesize(YUIDimension dim); - + virtual int preferredWidth(); + virtual int preferredHeight(); + void createLayout( const string & headline, const string & text, string okButtonLabel, -- 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