Updated support sources
Improved drawing. Strange drawing bug in BeDecorator buttons to be fixed later git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3893 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,3 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Copyright (c) 2001-2002, OpenBeOS
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
|
// to deal in the Software without restriction, including without limitation
|
||||||
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
// File Name: BeDecorator.cpp
|
||||||
|
// Author: DarkWyrm <[email protected]>
|
||||||
|
// Description: Decorator in the style of BeOS R5
|
||||||
|
//
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#include <Rect.h>
|
||||||
#include "DisplayDriver.h"
|
#include "DisplayDriver.h"
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
#include "LayerData.h"
|
#include "LayerData.h"
|
||||||
@@ -5,26 +32,25 @@
|
|||||||
#include "BeDecorator.h"
|
#include "BeDecorator.h"
|
||||||
#include "RGBColor.h"
|
#include "RGBColor.h"
|
||||||
|
|
||||||
//#define DEBUG_DECOR
|
//#define DEBUG_DECORATOR
|
||||||
|
|
||||||
#ifdef DEBUG_DECOR
|
|
||||||
|
#define USE_VIEW_FILL_HACK
|
||||||
|
|
||||||
|
#ifdef DEBUG_DECORATOR
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BeDecorator::BeDecorator(BRect rect, int32 wlook, int32 wfeel, int32 wflags)
|
BeDecorator::BeDecorator(BRect rect, int32 wlook, int32 wfeel, int32 wflags)
|
||||||
: Decorator(rect,wlook,wfeel,wflags)
|
: Decorator(rect,wlook,wfeel,wflags)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DECOR
|
|
||||||
printf("BeDecorator()\n");
|
|
||||||
#endif
|
|
||||||
taboffset=0;
|
taboffset=0;
|
||||||
|
titlepixelwidth=0;
|
||||||
|
|
||||||
|
_SetFocus();
|
||||||
|
|
||||||
// These hard-coded assignments will go bye-bye when the system _colors
|
// These hard-coded assignments will go bye-bye when the system _colors
|
||||||
// API is implemented
|
// API is implemented
|
||||||
|
|
||||||
// commented these out because they are taken care of by the SetFocus() call
|
|
||||||
SetFocus(false);
|
|
||||||
|
|
||||||
frame_highercol.SetColor(216,216,216);
|
frame_highercol.SetColor(216,216,216);
|
||||||
frame_lowercol.SetColor(110,110,110);
|
frame_lowercol.SetColor(110,110,110);
|
||||||
|
|
||||||
@@ -41,55 +67,85 @@ printf("BeDecorator()\n");
|
|||||||
solidhigh=0xFFFFFFFFFFFFFFFFLL;
|
solidhigh=0xFFFFFFFFFFFFFFFFLL;
|
||||||
solidlow=0;
|
solidlow=0;
|
||||||
|
|
||||||
tab_highcol=_colors->window_tab;
|
// tab_highcol=_colors->window_tab;
|
||||||
tab_lowcol=_colors->window_tab;
|
// tab_lowcol=_colors->window_tab;
|
||||||
|
|
||||||
|
#ifdef DEBUG_DECORATOR
|
||||||
|
printf("BeDecorator:\n");
|
||||||
|
printf("\tFrame (%.1f,%.1f,%.1f,%.1f)\n",rect.left,rect.top,rect.right,rect.bottom);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
BeDecorator::~BeDecorator(void)
|
BeDecorator::~BeDecorator(void)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DECOR
|
#ifdef DEBUG_DECORATOR
|
||||||
printf("~BeDecorator()\n");
|
printf("BeDecorator: ~BeDecorator()\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
click_type BeDecorator::Clicked(BPoint pt, int32 buttons, int32 modifiers)
|
click_type BeDecorator::Clicked(BPoint pt, int32 buttons, int32 modifiers)
|
||||||
{
|
{
|
||||||
if(_closerect.Contains(pt))
|
#ifdef DEBUG_DECORATOR
|
||||||
|
printf("BeDecorator: Clicked\n");
|
||||||
|
printf("\tPoint: (%.1f,%.1f)\n",pt.x,pt.y);
|
||||||
|
printf("\tButtons:\n");
|
||||||
|
if(buttons==0)
|
||||||
|
printf("\t\tNone\n");
|
||||||
|
else
|
||||||
{
|
{
|
||||||
|
if(buttons & B_PRIMARY_MOUSE_BUTTON)
|
||||||
#ifdef DEBUG_DECOR
|
printf("\t\tPrimary\n");
|
||||||
printf("BeDecorator():Clicked() - Close\n");
|
if(buttons & B_SECONDARY_MOUSE_BUTTON)
|
||||||
#endif
|
printf("\t\tSecondary\n");
|
||||||
|
if(buttons & B_TERTIARY_MOUSE_BUTTON)
|
||||||
return CLICK_CLOSE;
|
printf("\t\tTertiary\n");
|
||||||
}
|
}
|
||||||
|
printf("\tModifiers:\n");
|
||||||
|
if(modifiers==0)
|
||||||
|
printf("\t\tNone\n");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(modifiers & B_CAPS_LOCK)
|
||||||
|
printf("\t\tCaps Lock\n");
|
||||||
|
if(modifiers & B_NUM_LOCK)
|
||||||
|
printf("\t\tNum Lock\n");
|
||||||
|
if(modifiers & B_SCROLL_LOCK)
|
||||||
|
printf("\t\tScroll Lock\n");
|
||||||
|
if(modifiers & B_LEFT_COMMAND_KEY)
|
||||||
|
printf("\t\t Left Command\n");
|
||||||
|
if(modifiers & B_RIGHT_COMMAND_KEY)
|
||||||
|
printf("\t\t Right Command\n");
|
||||||
|
if(modifiers & B_LEFT_CONTROL_KEY)
|
||||||
|
printf("\t\tLeft Control\n");
|
||||||
|
if(modifiers & B_RIGHT_CONTROL_KEY)
|
||||||
|
printf("\t\tRight Control\n");
|
||||||
|
if(modifiers & B_LEFT_OPTION_KEY)
|
||||||
|
printf("\t\tLeft Option\n");
|
||||||
|
if(modifiers & B_RIGHT_OPTION_KEY)
|
||||||
|
printf("\t\tRight Option\n");
|
||||||
|
if(modifiers & B_LEFT_SHIFT_KEY)
|
||||||
|
printf("\t\tLeft Shift\n");
|
||||||
|
if(modifiers & B_RIGHT_SHIFT_KEY)
|
||||||
|
printf("\t\tRight Shift\n");
|
||||||
|
if(modifiers & B_MENU_KEY)
|
||||||
|
printf("\t\tMenu\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if(_closerect.Contains(pt))
|
||||||
|
return CLICK_CLOSE;
|
||||||
|
|
||||||
if(_zoomrect.Contains(pt))
|
if(_zoomrect.Contains(pt))
|
||||||
{
|
|
||||||
|
|
||||||
#ifdef DEBUG_DECOR
|
|
||||||
printf("BeDecorator():Clicked() - Zoom\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return CLICK_ZOOM;
|
return CLICK_ZOOM;
|
||||||
}
|
|
||||||
|
|
||||||
if(_resizerect.Contains(pt) && _look==B_DOCUMENT_WINDOW_LOOK)
|
if(_resizerect.Contains(pt) && _look==B_DOCUMENT_WINDOW_LOOK)
|
||||||
{
|
|
||||||
|
|
||||||
#ifdef DEBUG_DECOR
|
|
||||||
printf("BeDecorator():Clicked() - Resize thumb\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return CLICK_RESIZE;
|
return CLICK_RESIZE;
|
||||||
}
|
|
||||||
|
|
||||||
// Clicking in the tab?
|
// Clicking in the tab?
|
||||||
if(_tabrect.Contains(pt))
|
if(_tabrect.Contains(pt))
|
||||||
{
|
{
|
||||||
// Here's part of our window management stuff
|
// Here's part of our window management stuff
|
||||||
if(buttons==B_PRIMARY_MOUSE_BUTTON && !GetFocus())
|
// if(buttons==B_PRIMARY_MOUSE_BUTTON && !GetFocus())
|
||||||
return CLICK_MOVETOFRONT;
|
// return CLICK_MOVETOFRONT;
|
||||||
if(buttons==B_SECONDARY_MOUSE_BUTTON)
|
if(buttons==B_SECONDARY_MOUSE_BUTTON)
|
||||||
return CLICK_MOVETOBACK;
|
return CLICK_MOVETOBACK;
|
||||||
return CLICK_DRAG;
|
return CLICK_DRAG;
|
||||||
@@ -101,9 +157,6 @@ printf("BeDecorator():Clicked() - Resize thumb\n");
|
|||||||
BRect clientrect(brect.InsetByCopy(3,3));
|
BRect clientrect(brect.InsetByCopy(3,3));
|
||||||
if(brect.Contains(pt) && !clientrect.Contains(pt))
|
if(brect.Contains(pt) && !clientrect.Contains(pt))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DECOR
|
|
||||||
printf("BeDecorator():Clicked() - Drag\n");
|
|
||||||
#endif
|
|
||||||
if(_resizerect.Contains(pt))
|
if(_resizerect.Contains(pt))
|
||||||
return CLICK_RESIZE;
|
return CLICK_RESIZE;
|
||||||
|
|
||||||
@@ -111,28 +164,28 @@ printf("BeDecorator():Clicked() - Drag\n");
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Guess user didn't click anything
|
// Guess user didn't click anything
|
||||||
#ifdef DEBUG_DECOR
|
|
||||||
printf("BeDecorator():Clicked()\n");
|
|
||||||
#endif
|
|
||||||
return CLICK_NONE;
|
return CLICK_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BeDecorator::_DoLayout(void)
|
void BeDecorator::_DoLayout(void)
|
||||||
{
|
{
|
||||||
|
//debugger("");
|
||||||
|
#ifdef DEBUG_DECORATOR
|
||||||
|
printf("BeDecorator: Do Layout\n");
|
||||||
|
#endif
|
||||||
// Here we determine the size of every rectangle that we use
|
// Here we determine the size of every rectangle that we use
|
||||||
// internally when we are given the size of the client rectangle.
|
// internally when we are given the size of the client rectangle.
|
||||||
|
|
||||||
// Current version simply makes everything fit inside the rect
|
// Current version simply makes everything fit inside the rect
|
||||||
// instead of building around it. This will change.
|
// instead of building around it. This will change.
|
||||||
|
|
||||||
#ifdef DEBUG_DECOR
|
|
||||||
printf("BeDecorator()::_DoLayout()"); rect.PrintToStream();
|
|
||||||
#endif
|
|
||||||
_tabrect=_frame;
|
_tabrect=_frame;
|
||||||
_resizerect=_frame;
|
_resizerect=_frame;
|
||||||
_borderrect=_frame;
|
_borderrect=_frame;
|
||||||
_closerect=_frame;
|
_closerect=_frame;
|
||||||
|
|
||||||
|
textoffset=(_look==B_FLOATING_WINDOW_LOOK)?5:7;
|
||||||
|
|
||||||
_closerect.left+=(_look==B_FLOATING_WINDOW_LOOK)?2:4;
|
_closerect.left+=(_look==B_FLOATING_WINDOW_LOOK)?2:4;
|
||||||
_closerect.top+=(_look==B_FLOATING_WINDOW_LOOK)?6:4;
|
_closerect.top+=(_look==B_FLOATING_WINDOW_LOOK)?6:4;
|
||||||
_closerect.right=_closerect.left+10;
|
_closerect.right=_closerect.left+10;
|
||||||
@@ -144,16 +197,18 @@ printf("BeDecorator()::_DoLayout()"); rect.PrintToStream();
|
|||||||
_resizerect.left=_resizerect.right-18;
|
_resizerect.left=_resizerect.right-18;
|
||||||
|
|
||||||
_tabrect.bottom=_tabrect.top+18;
|
_tabrect.bottom=_tabrect.top+18;
|
||||||
/* if(GetTitle())
|
if(strlen(GetTitle())>1)
|
||||||
{
|
{
|
||||||
float titlewidth=_closerect.right
|
if(_driver)
|
||||||
+_driver->StringWidth(layer->name->String(),
|
titlepixelwidth=_driver->StringWidth(GetTitle(),_TitleWidth(), &_layerdata);
|
||||||
layer->name->Length())
|
else
|
||||||
+35;
|
titlepixelwidth=10;
|
||||||
_tabrect.right=(titlewidth<_frame.right -1)?titlewidth:_frame.right;
|
|
||||||
|
if(_closerect.right+textoffset+titlepixelwidth+35< _frame.Width()-1)
|
||||||
|
_tabrect.right=_tabrect.left+titlepixelwidth;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*/ _tabrect.right=_tabrect.left+_tabrect.Width()/2;
|
_tabrect.right=_tabrect.left+_tabrect.Width()/2;
|
||||||
|
|
||||||
if(_look==B_FLOATING_WINDOW_LOOK)
|
if(_look==B_FLOATING_WINDOW_LOOK)
|
||||||
_tabrect.top+=4;
|
_tabrect.top+=4;
|
||||||
@@ -165,7 +220,6 @@ printf("BeDecorator()::_DoLayout()"); rect.PrintToStream();
|
|||||||
_zoomrect.left=_zoomrect.right-10;
|
_zoomrect.left=_zoomrect.right-10;
|
||||||
_zoomrect.bottom=_zoomrect.top+10;
|
_zoomrect.bottom=_zoomrect.top+10;
|
||||||
|
|
||||||
textoffset=(_look==B_FLOATING_WINDOW_LOOK)?5:7;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BeDecorator::MoveBy(float x, float y)
|
void BeDecorator::MoveBy(float x, float y)
|
||||||
@@ -175,6 +229,9 @@ void BeDecorator::MoveBy(float x, float y)
|
|||||||
|
|
||||||
void BeDecorator::MoveBy(BPoint pt)
|
void BeDecorator::MoveBy(BPoint pt)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_DECORATOR
|
||||||
|
printf("BeDecorator: Move By (%.1f, %.1f)\n",pt.x,pt.y);
|
||||||
|
#endif
|
||||||
// Move all internal rectangles the appropriate amount
|
// Move all internal rectangles the appropriate amount
|
||||||
_frame.OffsetBy(pt);
|
_frame.OffsetBy(pt);
|
||||||
_closerect.OffsetBy(pt);
|
_closerect.OffsetBy(pt);
|
||||||
@@ -183,31 +240,38 @@ void BeDecorator::MoveBy(BPoint pt)
|
|||||||
_borderrect.OffsetBy(pt);
|
_borderrect.OffsetBy(pt);
|
||||||
_zoomrect.OffsetBy(pt);
|
_zoomrect.OffsetBy(pt);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
SRegion * BeDecorator::GetFootprint(void)
|
BRegion * BeDecorator::GetFootprint(void)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_DECORATOR
|
||||||
|
printf("BeDecorator: Get Footprint\n");
|
||||||
|
#endif
|
||||||
// This function calculates the decorator's footprint in coordinates
|
// This function calculates the decorator's footprint in coordinates
|
||||||
// relative to the layer. This is most often used to set a WindowBorder
|
// relative to the layer. This is most often used to set a WinBorder
|
||||||
// object's visible region.
|
// object's visible region.
|
||||||
|
|
||||||
SRegion *reg=new SRegion(_borderrect);
|
BRegion *reg=new BRegion(_borderrect);
|
||||||
reg->Include(_tabrect);
|
reg->Include(_tabrect);
|
||||||
return reg;
|
return reg;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
void BeDecorator::_DrawTitle(BRect r)
|
void BeDecorator::_DrawTitle(BRect r)
|
||||||
{
|
{
|
||||||
// Designed simply to redraw the title when it has changed on
|
// Designed simply to redraw the title when it has changed on
|
||||||
// the client side.
|
// the client side.
|
||||||
/* _driver->SetDrawingMode(B_OP_OVER);
|
_layerdata.highcolor=_colors->window_tab_text;
|
||||||
rgb_color tmpcol=_driver->HighColor();
|
_layerdata.lowcolor=(GetFocus())?_colors->window_tab:_colors->inactive_window_tab;
|
||||||
_driver->SetHighColor(textcol.red,textcol.green,textcol.blue);
|
|
||||||
_driver->DrawString((char *)string,strlen(string),
|
int32 titlecount=_ClipTitle((_zoomrect.left-5)-(_closerect.right+textoffset));
|
||||||
BPoint(_closerect.right+textoffset,_closerect.bottom-1));
|
BString titlestr=GetTitle();
|
||||||
_driver->SetHighColor(tmpcol.red,tmpcol.green,tmpcol.blue);
|
if(titlecount<titlestr.CountChars())
|
||||||
_driver->SetDrawingMode(B_OP_COPY);
|
{
|
||||||
*/
|
titlestr.Truncate(titlecount-1);
|
||||||
|
titlestr+="...";
|
||||||
|
titlecount+=2;
|
||||||
|
}
|
||||||
|
_driver->DrawString(titlestr.String(),titlecount,
|
||||||
|
BPoint(_closerect.right+textoffset,_closerect.bottom+1),&_layerdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BeDecorator::_SetFocus(void)
|
void BeDecorator::_SetFocus(void)
|
||||||
@@ -217,36 +281,30 @@ void BeDecorator::_SetFocus(void)
|
|||||||
|
|
||||||
if(GetFocus())
|
if(GetFocus())
|
||||||
{
|
{
|
||||||
// tab_highcol.SetColor(255,236,33);
|
button_highcol.SetColor(tint_color(_colors->window_tab.GetColor32(),B_LIGHTEN_2_TINT));
|
||||||
// tab_lowcol.SetColor(234,181,0);
|
button_lowcol.SetColor(tint_color(_colors->window_tab.GetColor32(),B_DARKEN_2_TINT));
|
||||||
tab_highcol=_colors->window_tab;
|
textcol=_colors->window_tab_text;
|
||||||
tab_lowcol=_colors->window_tab;
|
|
||||||
|
|
||||||
button_highcol.SetColor(255,255,0);
|
|
||||||
button_lowcol.SetColor(255,203,0);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tab_highcol.SetColor(235,235,235);
|
button_highcol.SetColor(tint_color(_colors->inactive_window_tab.GetColor32(),B_LIGHTEN_2_TINT));
|
||||||
tab_lowcol.SetColor(160,160,160);
|
button_lowcol.SetColor(tint_color(_colors->inactive_window_tab.GetColor32(),B_DARKEN_2_TINT));
|
||||||
|
textcol=_colors->inactive_window_tab_text;
|
||||||
button_highcol.SetColor(229,229,229);
|
|
||||||
button_lowcol.SetColor(153,153,153);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BeDecorator::Draw(BRect update)
|
void BeDecorator::Draw(BRect update)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_DECORATOR
|
||||||
|
printf("BeDecorator: Draw(%.1f,%.1f,%.1f,%.1f)\n",update.left,update.top,update.right,update.bottom);
|
||||||
|
#endif
|
||||||
// We need to draw a few things: the tab, the resize thumb, the borders,
|
// We need to draw a few things: the tab, the resize thumb, the borders,
|
||||||
// and the buttons
|
// and the buttons
|
||||||
|
|
||||||
_DrawTab(update);
|
_DrawTab(update);
|
||||||
|
|
||||||
// Draw the top view's client area - just a hack :)
|
// Draw the top view's client area - just a hack :)
|
||||||
RGBColor blue(100,100,255);
|
_layerdata.highcolor=_colors->document_background;
|
||||||
|
|
||||||
_layerdata.highcolor=blue;
|
|
||||||
|
|
||||||
if(_borderrect.Intersects(update))
|
if(_borderrect.Intersects(update))
|
||||||
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
||||||
@@ -260,9 +318,7 @@ void BeDecorator::Draw(void)
|
|||||||
// things
|
// things
|
||||||
|
|
||||||
// Draw the top view's client area - just a hack :)
|
// Draw the top view's client area - just a hack :)
|
||||||
RGBColor blue(100,100,255);
|
_layerdata.highcolor=_colors->document_background;
|
||||||
|
|
||||||
_layerdata.highcolor=blue;
|
|
||||||
|
|
||||||
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
||||||
DrawFrame();
|
DrawFrame();
|
||||||
@@ -296,13 +352,12 @@ void BeDecorator::_DrawTab(BRect r)
|
|||||||
if(_look==B_NO_BORDER_WINDOW_LOOK)
|
if(_look==B_NO_BORDER_WINDOW_LOOK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
_layerdata.highcolor=(GetFocus())?_colors->window_tab:_colors->inactive_window_tab;
|
||||||
|
_driver->FillRect(_tabrect,&_layerdata,(int8*)&solidhigh);
|
||||||
_layerdata.highcolor=frame_lowcol;
|
_layerdata.highcolor=frame_lowcol;
|
||||||
_driver->StrokeRect(_tabrect,&_layerdata,(int8*)&solidhigh);
|
_driver->StrokeLine(_tabrect.LeftBottom(),_tabrect.RightBottom(),&_layerdata,(int8*)&solidhigh);
|
||||||
|
|
||||||
// UpdateTitle(layer->name->String());
|
_DrawTitle(_tabrect);
|
||||||
|
|
||||||
_layerdata.highcolor=_colors->window_tab;
|
|
||||||
_driver->FillRect(_tabrect.InsetByCopy(1,1),&_layerdata,(int8*)&solidhigh);
|
|
||||||
|
|
||||||
// Draw the buttons if we're supposed to
|
// Draw the buttons if we're supposed to
|
||||||
if(!(_flags & B_NOT_CLOSABLE))
|
if(!(_flags & B_NOT_CLOSABLE))
|
||||||
@@ -311,6 +366,11 @@ void BeDecorator::_DrawTab(BRect r)
|
|||||||
_DrawZoom(_zoomrect);
|
_DrawZoom(_zoomrect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BeDecorator::_SetColors(void)
|
||||||
|
{
|
||||||
|
_SetFocus();
|
||||||
|
}
|
||||||
|
|
||||||
void BeDecorator::DrawBlendedRect(BRect r, bool down)
|
void BeDecorator::DrawBlendedRect(BRect r, bool down)
|
||||||
{
|
{
|
||||||
// This bad boy is used to draw a rectangle with a gradient.
|
// This bad boy is used to draw a rectangle with a gradient.
|
||||||
@@ -371,6 +431,10 @@ void BeDecorator::_DrawFrame(BRect rect)
|
|||||||
{
|
{
|
||||||
// Duh, draws the window frame, I think. ;)
|
// Duh, draws the window frame, I think. ;)
|
||||||
|
|
||||||
|
#ifdef USE_VIEW_FILL_HACK
|
||||||
|
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(_look==B_NO_BORDER_WINDOW_LOOK)
|
if(_look==B_NO_BORDER_WINDOW_LOOK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,34 @@
|
|||||||
#ifndef _BEOS_DECORATOR_H_
|
//------------------------------------------------------------------------------
|
||||||
#define _BEOS_DECORATOR_H_
|
// Copyright (c) 2001-2002, OpenBeOS
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
|
// to deal in the Software without restriction, including without limitation
|
||||||
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
// File Name: BeDecorator.cpp
|
||||||
|
// Author: DarkWyrm <[email protected]>
|
||||||
|
// Description: Decorator in the style of BeOS R5
|
||||||
|
//
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#ifndef _BE_DECORATOR_H_
|
||||||
|
#define _BE_DECORATOR_H_
|
||||||
|
|
||||||
#include "Decorator.h"
|
#include "Decorator.h"
|
||||||
|
#include <Region.h>
|
||||||
|
|
||||||
class BeDecorator: public Decorator
|
class BeDecorator: public Decorator
|
||||||
{
|
{
|
||||||
@@ -11,13 +38,10 @@ public:
|
|||||||
|
|
||||||
void MoveBy(float x, float y);
|
void MoveBy(float x, float y);
|
||||||
void MoveBy(BPoint pt);
|
void MoveBy(BPoint pt);
|
||||||
// void ResizeBy(float x, float y);
|
|
||||||
// void ResizeBy(BPoint pt);
|
|
||||||
void Draw(BRect r);
|
void Draw(BRect r);
|
||||||
void Draw(void);
|
void Draw(void);
|
||||||
//SRegion GetFootprint(void);
|
BRegion *GetFootprint(void);
|
||||||
click_type Clicked(BPoint pt, int32 buttons, int32 modifiers);
|
click_type Clicked(BPoint pt, int32 buttons, int32 modifiers);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _DrawClose(BRect r);
|
void _DrawClose(BRect r);
|
||||||
void _DrawFrame(BRect r);
|
void _DrawFrame(BRect r);
|
||||||
@@ -26,6 +50,7 @@ protected:
|
|||||||
void _DrawZoom(BRect r);
|
void _DrawZoom(BRect r);
|
||||||
void _DoLayout(void);
|
void _DoLayout(void);
|
||||||
void _SetFocus(void);
|
void _SetFocus(void);
|
||||||
|
void _SetColors(void);
|
||||||
void DrawBlendedRect(BRect r, bool down);
|
void DrawBlendedRect(BRect r, bool down);
|
||||||
uint32 taboffset;
|
uint32 taboffset;
|
||||||
|
|
||||||
@@ -38,6 +63,7 @@ protected:
|
|||||||
|
|
||||||
bool slidetab;
|
bool slidetab;
|
||||||
int textoffset;
|
int textoffset;
|
||||||
|
float titlepixelwidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ Decorator::Decorator(BRect rect, int32 wlook, int32 wfeel, int32 wflags)
|
|||||||
_close_state=false;
|
_close_state=false;
|
||||||
_minimize_state=false;
|
_minimize_state=false;
|
||||||
_zoom_state=false;
|
_zoom_state=false;
|
||||||
_title_string=new BString;
|
_has_focus=false;
|
||||||
|
_title_string=new BString("");
|
||||||
_driver=NULL;
|
_driver=NULL;
|
||||||
|
|
||||||
_closerect.Set(0,0,1,1);
|
_closerect.Set(0,0,1,1);
|
||||||
@@ -83,8 +84,8 @@ Decorator::~Decorator(void)
|
|||||||
*/
|
*/
|
||||||
void Decorator::SetColors(const ColorSet &cset)
|
void Decorator::SetColors(const ColorSet &cset)
|
||||||
{
|
{
|
||||||
if(_colors)
|
|
||||||
_colors->SetColors(cset);
|
_colors->SetColors(cset);
|
||||||
|
_SetColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -232,6 +233,7 @@ int32 Decorator::GetFlags(void)
|
|||||||
void Decorator::SetTitle(const char *string)
|
void Decorator::SetTitle(const char *string)
|
||||||
{
|
{
|
||||||
_title_string->SetTo(string);
|
_title_string->SetTo(string);
|
||||||
|
_DoLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -330,7 +332,7 @@ void Decorator::MoveBy(BPoint pt)
|
|||||||
necessarily reflect _tabrect offset by the amount given - few people want to
|
necessarily reflect _tabrect offset by the amount given - few people want to
|
||||||
slide a tab right off the window - that would be a Bad Thing (TM).
|
slide a tab right off the window - that would be a Bad Thing (TM).
|
||||||
*/
|
*/
|
||||||
BRect Decorator::SlideTab(float dx, float dy=0)
|
BRect Decorator::SlideTab(float dx, float dy)
|
||||||
{
|
{
|
||||||
return BRect(0,0,0,0);
|
return BRect(0,0,0,0);
|
||||||
}
|
}
|
||||||
@@ -486,6 +488,16 @@ void Decorator::_DrawZoom(BRect r)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Hook function for when the color set is updated
|
||||||
|
|
||||||
|
This function is called after the decorator's color set is updated. Quite useful
|
||||||
|
if the decorator uses colors based on those in the system.
|
||||||
|
*/
|
||||||
|
void Decorator::_SetColors(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Returns the "footprint" of the entire window, including decorator
|
\brief Returns the "footprint" of the entire window, including decorator
|
||||||
\return Region representing the window's screen footprint
|
\return Region representing the window's screen footprint
|
||||||
|
|||||||
@@ -95,6 +95,11 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int32 _ClipTitle(float width);
|
int32 _ClipTitle(float width);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Returns the number of characters in the title
|
||||||
|
\return The title character count
|
||||||
|
*/
|
||||||
int32 _TitleWidth(void) { return (_title_string)?_title_string->CountChars():0; }
|
int32 _TitleWidth(void) { return (_title_string)?_title_string->CountChars():0; }
|
||||||
|
|
||||||
virtual void _DrawClose(BRect r);
|
virtual void _DrawClose(BRect r);
|
||||||
@@ -105,6 +110,7 @@ protected:
|
|||||||
virtual void _DrawZoom(BRect r);
|
virtual void _DrawZoom(BRect r);
|
||||||
virtual void _SetFocus(void)=0;
|
virtual void _SetFocus(void)=0;
|
||||||
virtual void _DoLayout(void)=0;
|
virtual void _DoLayout(void)=0;
|
||||||
|
virtual void _SetColors(void);
|
||||||
|
|
||||||
ColorSet *_colors;
|
ColorSet *_colors;
|
||||||
DisplayDriver *_driver;
|
DisplayDriver *_driver;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define LAYERDATA_H_
|
#define LAYERDATA_H_
|
||||||
|
|
||||||
#include <Point.h>
|
#include <Point.h>
|
||||||
|
#include <View.h>
|
||||||
class ServerBitmap;
|
class ServerBitmap;
|
||||||
|
|
||||||
class LayerData
|
class LayerData
|
||||||
@@ -11,9 +12,9 @@ LayerData(void)
|
|||||||
{
|
{
|
||||||
pensize=1.0;
|
pensize=1.0;
|
||||||
penlocation.Set(0,0);
|
penlocation.Set(0,0);
|
||||||
drawing_mode=0;
|
draw_mode=B_OP_COPY;
|
||||||
bitmap_background=NULL;
|
background=NULL;
|
||||||
bitmap_overlay=NULL;
|
overlay=NULL;
|
||||||
highcolor.SetColor(0,0,0,255);
|
highcolor.SetColor(0,0,0,255);
|
||||||
lowcolor.SetColor(255,255,255,255);
|
lowcolor.SetColor(255,255,255,255);
|
||||||
//SFont font;
|
//SFont font;
|
||||||
@@ -23,13 +24,15 @@ LayerData(void)
|
|||||||
|
|
||||||
float pensize;
|
float pensize;
|
||||||
BPoint penlocation;
|
BPoint penlocation;
|
||||||
int32 drawing_mode;
|
drawing_mode draw_mode;
|
||||||
ServerBitmap *bitmap_background;
|
source_alpha alpha_mode;
|
||||||
ServerBitmap *bitmap_overlay;
|
alpha_function blending_mode;
|
||||||
RGBColor highcolor, lowcolor;
|
ServerBitmap *background;
|
||||||
//SFont font;
|
ServerBitmap *overlay;
|
||||||
//bool antialias_text;
|
RGBColor highcolor, lowcolor, viewcolor;
|
||||||
|
// ServerFont *font;
|
||||||
float scale;
|
float scale;
|
||||||
|
escapement_delta edelta;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ Decorator::Decorator(BRect rect, int32 wlook, int32 wfeel, int32 wflags)
|
|||||||
_close_state=false;
|
_close_state=false;
|
||||||
_minimize_state=false;
|
_minimize_state=false;
|
||||||
_zoom_state=false;
|
_zoom_state=false;
|
||||||
_title_string=new BString;
|
_has_focus=false;
|
||||||
|
_title_string=new BString("");
|
||||||
_driver=NULL;
|
_driver=NULL;
|
||||||
|
|
||||||
_closerect.Set(0,0,1,1);
|
_closerect.Set(0,0,1,1);
|
||||||
@@ -83,8 +84,8 @@ Decorator::~Decorator(void)
|
|||||||
*/
|
*/
|
||||||
void Decorator::SetColors(const ColorSet &cset)
|
void Decorator::SetColors(const ColorSet &cset)
|
||||||
{
|
{
|
||||||
if(_colors)
|
|
||||||
_colors->SetColors(cset);
|
_colors->SetColors(cset);
|
||||||
|
_SetColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -232,6 +233,7 @@ int32 Decorator::GetFlags(void)
|
|||||||
void Decorator::SetTitle(const char *string)
|
void Decorator::SetTitle(const char *string)
|
||||||
{
|
{
|
||||||
_title_string->SetTo(string);
|
_title_string->SetTo(string);
|
||||||
|
_DoLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -330,7 +332,7 @@ void Decorator::MoveBy(BPoint pt)
|
|||||||
necessarily reflect _tabrect offset by the amount given - few people want to
|
necessarily reflect _tabrect offset by the amount given - few people want to
|
||||||
slide a tab right off the window - that would be a Bad Thing (TM).
|
slide a tab right off the window - that would be a Bad Thing (TM).
|
||||||
*/
|
*/
|
||||||
BRect Decorator::SlideTab(float dx, float dy=0)
|
BRect Decorator::SlideTab(float dx, float dy)
|
||||||
{
|
{
|
||||||
return BRect(0,0,0,0);
|
return BRect(0,0,0,0);
|
||||||
}
|
}
|
||||||
@@ -486,6 +488,16 @@ void Decorator::_DrawZoom(BRect r)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Hook function for when the color set is updated
|
||||||
|
|
||||||
|
This function is called after the decorator's color set is updated. Quite useful
|
||||||
|
if the decorator uses colors based on those in the system.
|
||||||
|
*/
|
||||||
|
void Decorator::_SetColors(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Returns the "footprint" of the entire window, including decorator
|
\brief Returns the "footprint" of the entire window, including decorator
|
||||||
\return Region representing the window's screen footprint
|
\return Region representing the window's screen footprint
|
||||||
|
|||||||
@@ -95,6 +95,11 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int32 _ClipTitle(float width);
|
int32 _ClipTitle(float width);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Returns the number of characters in the title
|
||||||
|
\return The title character count
|
||||||
|
*/
|
||||||
int32 _TitleWidth(void) { return (_title_string)?_title_string->CountChars():0; }
|
int32 _TitleWidth(void) { return (_title_string)?_title_string->CountChars():0; }
|
||||||
|
|
||||||
virtual void _DrawClose(BRect r);
|
virtual void _DrawClose(BRect r);
|
||||||
@@ -105,6 +110,7 @@ protected:
|
|||||||
virtual void _DrawZoom(BRect r);
|
virtual void _DrawZoom(BRect r);
|
||||||
virtual void _SetFocus(void)=0;
|
virtual void _SetFocus(void)=0;
|
||||||
virtual void _DoLayout(void)=0;
|
virtual void _DoLayout(void)=0;
|
||||||
|
virtual void _SetColors(void);
|
||||||
|
|
||||||
ColorSet *_colors;
|
ColorSet *_colors;
|
||||||
DisplayDriver *_driver;
|
DisplayDriver *_driver;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define LAYERDATA_H_
|
#define LAYERDATA_H_
|
||||||
|
|
||||||
#include <Point.h>
|
#include <Point.h>
|
||||||
|
#include <View.h>
|
||||||
class ServerBitmap;
|
class ServerBitmap;
|
||||||
|
|
||||||
class LayerData
|
class LayerData
|
||||||
@@ -11,9 +12,9 @@ LayerData(void)
|
|||||||
{
|
{
|
||||||
pensize=1.0;
|
pensize=1.0;
|
||||||
penlocation.Set(0,0);
|
penlocation.Set(0,0);
|
||||||
drawing_mode=0;
|
draw_mode=B_OP_COPY;
|
||||||
bitmap_background=NULL;
|
background=NULL;
|
||||||
bitmap_overlay=NULL;
|
overlay=NULL;
|
||||||
highcolor.SetColor(0,0,0,255);
|
highcolor.SetColor(0,0,0,255);
|
||||||
lowcolor.SetColor(255,255,255,255);
|
lowcolor.SetColor(255,255,255,255);
|
||||||
//SFont font;
|
//SFont font;
|
||||||
@@ -23,13 +24,15 @@ LayerData(void)
|
|||||||
|
|
||||||
float pensize;
|
float pensize;
|
||||||
BPoint penlocation;
|
BPoint penlocation;
|
||||||
int32 drawing_mode;
|
drawing_mode draw_mode;
|
||||||
ServerBitmap *bitmap_background;
|
source_alpha alpha_mode;
|
||||||
ServerBitmap *bitmap_overlay;
|
alpha_function blending_mode;
|
||||||
RGBColor highcolor, lowcolor;
|
ServerBitmap *background;
|
||||||
//SFont font;
|
ServerBitmap *overlay;
|
||||||
//bool antialias_text;
|
RGBColor highcolor, lowcolor, viewcolor;
|
||||||
|
// ServerFont *font;
|
||||||
float scale;
|
float scale;
|
||||||
|
escapement_delta edelta;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,6 @@ printf("WinDecorator()\n");
|
|||||||
#endif
|
#endif
|
||||||
taboffset=0;
|
taboffset=0;
|
||||||
|
|
||||||
// These hard-coded assignments will go bye-bye when the system colors
|
|
||||||
// API is implemented
|
|
||||||
tab_highcol.SetColor(100,100,255);
|
|
||||||
tab_lowcol.SetColor(40,0,255);
|
|
||||||
|
|
||||||
button_highercol.SetColor(255,255,255);
|
button_highercol.SetColor(255,255,255);
|
||||||
button_lowercol.SetColor(0,0,0);
|
button_lowercol.SetColor(0,0,0);
|
||||||
|
|
||||||
@@ -34,8 +29,6 @@ printf("WinDecorator()\n");
|
|||||||
frame_highercol.SetColor(216,216,216);
|
frame_highercol.SetColor(216,216,216);
|
||||||
frame_lowercol.SetColor(110,110,110);
|
frame_lowercol.SetColor(110,110,110);
|
||||||
|
|
||||||
textcol.SetColor(0,0,0);
|
|
||||||
|
|
||||||
frame_highcol=frame_lowercol.MakeBlendColor(frame_highercol,0.75);
|
frame_highcol=frame_lowercol.MakeBlendColor(frame_highercol,0.75);
|
||||||
frame_midcol=frame_lowercol.MakeBlendColor(frame_highercol,0.5);
|
frame_midcol=frame_lowercol.MakeBlendColor(frame_highercol,0.5);
|
||||||
frame_lowcol=frame_lowercol.MakeBlendColor(frame_highercol,0.25);
|
frame_lowcol=frame_lowercol.MakeBlendColor(frame_highercol,0.25);
|
||||||
@@ -182,13 +175,17 @@ void WinDecorator::_SetFocus(void)
|
|||||||
|
|
||||||
if(GetFocus())
|
if(GetFocus())
|
||||||
{
|
{
|
||||||
tab_highcol.SetColor(100,100,255);
|
// tab_highcol.SetColor(100,100,255);
|
||||||
tab_lowcol.SetColor(40,0,255);
|
// tab_lowcol.SetColor(40,0,255);
|
||||||
|
tab_highcol=_colors->window_tab;
|
||||||
|
textcol=_colors->window_tab_text;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tab_highcol.SetColor(220,220,220);
|
// tab_highcol.SetColor(220,220,220);
|
||||||
tab_lowcol.SetColor(128,128,128);
|
// tab_lowcol.SetColor(128,128,128);
|
||||||
|
tab_highcol=_colors->inactive_window_tab;
|
||||||
|
textcol=_colors->inactive_window_tab_text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,9 +195,11 @@ void WinDecorator::Draw(BRect update)
|
|||||||
printf("WinDecorator::Draw(): "); update.PrintToStream();
|
printf("WinDecorator::Draw(): "); update.PrintToStream();
|
||||||
#endif
|
#endif
|
||||||
// Draw the top view's client area - just a hack :)
|
// Draw the top view's client area - just a hack :)
|
||||||
RGBColor blue(100,100,255);
|
// RGBColor blue(100,100,255);
|
||||||
|
// _layerdata.highcolor=blue;
|
||||||
|
|
||||||
_layerdata.highcolor=blue;
|
_layerdata.highcolor=_colors->document_background;
|
||||||
|
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
||||||
|
|
||||||
if(_borderrect.Intersects(update))
|
if(_borderrect.Intersects(update))
|
||||||
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
||||||
@@ -216,9 +215,11 @@ printf("WinDecorator::Draw()\n");
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Draw the top view's client area - just a hack :)
|
// Draw the top view's client area - just a hack :)
|
||||||
RGBColor blue(100,100,255);
|
// RGBColor blue(100,100,255);
|
||||||
|
// _layerdata.highcolor=blue;
|
||||||
|
|
||||||
_layerdata.highcolor=blue;
|
_layerdata.highcolor=_colors->document_background;
|
||||||
|
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
||||||
|
|
||||||
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
_driver->FillRect(_borderrect,&_layerdata,(int8*)&solidhigh);
|
||||||
DrawFrame();
|
DrawFrame();
|
||||||
@@ -270,7 +271,7 @@ void WinDecorator::_DrawTab(BRect r)
|
|||||||
|
|
||||||
// UpdateTitle(layer->name->String());
|
// UpdateTitle(layer->name->String());
|
||||||
|
|
||||||
_layerdata.highcolor=tab_lowcol;
|
_layerdata.highcolor=tab_highcol;
|
||||||
_driver->FillRect(_tabrect.InsetByCopy(1,1),&_layerdata,(int8*)&solidhigh);
|
_driver->FillRect(_tabrect.InsetByCopy(1,1),&_layerdata,(int8*)&solidhigh);
|
||||||
|
|
||||||
// Draw the buttons if we're supposed to
|
// Draw the buttons if we're supposed to
|
||||||
@@ -336,6 +337,11 @@ void WinDecorator::DrawBlendedRect(BRect r, bool down)
|
|||||||
_driver->StrokeRect(r,&_layerdata,(int8*)&solidhigh);
|
_driver->StrokeRect(r,&_layerdata,(int8*)&solidhigh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WinDecorator::_SetColors(void)
|
||||||
|
{
|
||||||
|
_SetFocus();
|
||||||
|
}
|
||||||
|
|
||||||
void WinDecorator::_DrawFrame(BRect rect)
|
void WinDecorator::_DrawFrame(BRect rect)
|
||||||
{
|
{
|
||||||
if(_look==B_NO_BORDER_WINDOW_LOOK)
|
if(_look==B_NO_BORDER_WINDOW_LOOK)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ protected:
|
|||||||
void _DrawMinimize(BRect r);
|
void _DrawMinimize(BRect r);
|
||||||
void _DoLayout(void);
|
void _DoLayout(void);
|
||||||
void _SetFocus(void);
|
void _SetFocus(void);
|
||||||
|
void _SetColors(void);
|
||||||
void DrawBlendedRect(BRect r, bool down);
|
void DrawBlendedRect(BRect r, bool down);
|
||||||
uint32 taboffset;
|
uint32 taboffset;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user