Minor update

This commit is contained in:
ocoursiere
2002-09-22 12:33:00 +00:00
parent 5aac0739ca
commit d6e0e93eed
9 changed files with 79 additions and 11 deletions

View File

@@ -86,7 +86,7 @@ BView_WindowActivated_hook View_WindowActivated_hook;
}
#endif
class BPView : public BView, public BPHandler
class BPView : public BView, public virtual BPHandler
{
public:
BPView(TPasObject PasObject,
@@ -94,6 +94,7 @@ class BPView : public BView, public BPHandler
const char *name,
uint32 resizingMode,
uint32 flags);
BPView(TPasObject PasObject, BMessage *archive);
// virtual void DispatchMessage(BMessage *message, BHandler *target);
// virtual bool QuitRequested(void);
virtual void AllAttached(void);
@@ -123,7 +124,15 @@ BPView::BPView(TPasObject PasObject,
uint32 resizingMode,
uint32 flags)
: BView(frame, name, resizingMode, flags),
BPHandler(PasObject)
BPHandler(PasObject),
BPasObject(PasObject)
{
}
BPView::BPView(TPasObject PasObject, BMessage *archive)
: BView(archive),
BPHandler(PasObject),
BPasObject(PasObject)
{
}
@@ -423,6 +432,7 @@ BView_Window(BView *View)
// TODO : implement hook function
/***********************************************************************
* Method: BView::Draw
* Params: BRect updateRect
@@ -437,6 +447,31 @@ BView_Draw(BView *View, BRect updateRect)
// END TODO implement hook function
/***********************************************************************
* Method: BView::SetViewColor
* Params: rgb_color c
* Returns: void
* Effects:
***********************************************************************/
void
BView_SetViewColor(BView *View, rgb_color c)
{
View->SetViewColor(c);
}
/***********************************************************************
* Method: BView::ViewColor
* Params:
* Returns: rgb_color
* Effects:
***********************************************************************/
rgb_color
BView_ViewColor(BView *View)
{
return View->ViewColor();
}
#if defined(__cplusplus)
}
#endif

View File

@@ -58,7 +58,9 @@ BPWindow::BPWindow(TPasObject PasObject,
uint32 flags,
uint32 workspaces = B_CURRENT_WORKSPACE)
: BWindow(frame, title, type, flags, workspaces),
BPLooper(PasObject)
BPLooper(PasObject),
BPHandler(PasObject, title),
BPasObject(PasObject)
{
}

View File

@@ -21,7 +21,8 @@ unit View;
interface
uses
beobj, handler, rect, os, application, appdefs, message;
beobj, handler, rect, os, application, appdefs, message,
graphicdefs;
type
// TWindow = class(TBeObject);
@@ -57,6 +58,7 @@ type
function NextSibling : TView;
function PreviousSibling : TView;
// function Window : TWindow;
procedure SetViewColor(rgb_color : TRGB_color);
end;
function BView_Create(AObject : TObject; frame : TCPlusObject; name : PChar;
@@ -71,6 +73,7 @@ function BView_PreviousSibling(CPlusObject : TCPlusObject) : TCPlusObject; cdecl
function BView_ChildAt(CPlusObject : TCPlusObject; index : integer) : TCPlusObject; cdecl; external BePascalLibName name 'BView_ChildAt';
function BView_Window(CPlusObject : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BView_Window';
procedure BView_Draw(CPlusObject : TCPlusObject; aRect : TCPlusObject); cdecl; external BePascalLibName name 'BView_Draw';
procedure BView_SetViewColor(CPlusObject : TCPlusObject; c : TRGB_color); cdecl; external BePascalLibName name 'BView_SetViewColor';
var
// resizingMode mask
@@ -273,6 +276,11 @@ begin
Result := TWindow.Wrap(BView_Window(Self.CPlusObject));
end;}
procedure TView.SetViewColor(rgb_color : TRGB_color);
begin
BView_SetViewColor(Self.CPlusObject, rgb_color);
end;
// Hook functions
procedure View_AllAttached_hook_func(View : TView); cdecl;
begin