HTMLPane now respects size from HT (in pixels or percentages).

This commit is contained in:
pinkerton%netscape.com 1998-09-14 18:44:19 +00:00
Родитель 53ee198a2b
Коммит a36aa17f04
1 изменённых файлов: 22 добавлений и 6 удалений

Просмотреть файл

@ -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();