From a36aa17f042840a972da22f4c65338e676bc59f7 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Mon, 14 Sep 1998 18:44:19 +0000 Subject: [PATCH] HTMLPane now respects size from HT (in pixels or percentages). --- cmd/macfe/rdfui/CRDFCoordinator.cp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/cmd/macfe/rdfui/CRDFCoordinator.cp b/cmd/macfe/rdfui/CRDFCoordinator.cp index c188f3787393..949b99a4f5d5 100644 --- a/cmd/macfe/rdfui/CRDFCoordinator.cp +++ b/cmd/macfe/rdfui/CRDFCoordinator.cp @@ -828,15 +828,31 @@ CDockedRDFCoordinator :: ShowAdSpace ( ) void CDockedRDFCoordinator :: SetAdSpaceToCorrectSize ( HT_View inView ) { - const kDefaultHeight = 200; - - //еее get the html area size property, convert it from % to pixel value and - //еее set the size of the pane accordingly. - const char* height = HT_HTMLPaneHeight(inView); - Uint32 adSpaceHeight = kDefaultHeight; //еее use |height| + const kDefaultHeight = 100; + Int32 adSpaceHeight = kDefaultHeight; SDimension16 size; GetFrameSize(size); + + // get the html area size property, convert it from % to pixel value and + // set the size of the pane accordingly. + string height = HT_HTMLPaneHeight(inView); + string::iterator percent = find ( height.begin(), height.end(), '%' ); + if ( percent != height.end() ) { + // we know it is a percentage now, not a fixed height. Cut off string at + // the '%' and use it as a percentage of the total height. + *percent = NULL; + adSpaceHeight = size.height * ((double)abs(atoi(height.c_str())) / (double)100); + if ( ! adSpaceHeight ) + adSpaceHeight = kDefaultHeight; // sanity check + } + else { + // it's either a number or it's not specified so we need to make it the default + adSpaceHeight = abs ( atoi(height.c_str()) ); + if ( ! adSpaceHeight ) + adSpaceHeight = kDefaultHeight; + } + Uint32 desiredPosition = size.height - adSpaceHeight; LDividedView* divView = AdSpaceShelf().GetShelf();