BButton is now wrapped ! Be GUI apps in pascal are comming soon.
This commit is contained in:
@@ -73,23 +73,44 @@ BPApplication::BPApplication(TPasObject PasObject, const char *signature,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BPApplication::AppActivated(bool active)
|
void BPApplication::AppActivated(bool active)
|
||||||
|
{
|
||||||
|
AppActivated_hookCall(active);
|
||||||
|
BApplication::AppActivated(active);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPApplication::AppActivated_hookCall(bool active)
|
||||||
{
|
{
|
||||||
Application_AppActivated_hook(GetPasObject(), active);
|
Application_AppActivated_hook(GetPasObject(), active);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BPApplication::ReadyToRun(void)
|
void BPApplication::ReadyToRun(void)
|
||||||
|
{
|
||||||
|
ReadyToRun_hookCall();
|
||||||
|
BApplication::ReadyToRun();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPApplication::ReadyToRun_hookCall(void)
|
||||||
{
|
{
|
||||||
Application_ReadyToRun_hook(GetPasObject());
|
Application_ReadyToRun_hook(GetPasObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BPApplication::QuitRequested(void)
|
bool BPApplication::QuitRequested(void)
|
||||||
{
|
{
|
||||||
return BPLooper::QuitRequested();
|
return QuitRequested_hookCall();
|
||||||
|
// return BApplication::QuitRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BPApplication::MessageReceived(BMessage *message)
|
void BPApplication::MessageReceived(BMessage *message)
|
||||||
{
|
{
|
||||||
BPHandler::MessageReceived(message);
|
MessageReceived_hookCall(message);
|
||||||
|
BApplication::MessageReceived(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPApplication::DispatchMessage(BMessage *message, BHandler *target)
|
||||||
|
{
|
||||||
|
DispatchMessage_hookCall(message, target);
|
||||||
|
// message->PrintToStream();
|
||||||
|
BApplication::DispatchMessage(message, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|||||||
@@ -24,10 +24,6 @@
|
|||||||
#include <handler.h>
|
#include <handler.h>
|
||||||
#include <beobj.h>
|
#include <beobj.h>
|
||||||
|
|
||||||
// definition of callback function in BHandler
|
|
||||||
|
|
||||||
typedef void (*BHandler_MessageReceived_hook) (TPasObject PasObject, TCPlusObject message);
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -43,6 +39,7 @@ BPHandler::BPHandler(TPasObject PasObject, const char *name)
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BPHandler::BPHandler(TPasObject PasObject, BMessage *archive)
|
BPHandler::BPHandler(TPasObject PasObject, BMessage *archive)
|
||||||
: BHandler(archive), BPasObject(PasObject)
|
: BHandler(archive), BPasObject(PasObject)
|
||||||
{
|
{
|
||||||
@@ -55,7 +52,13 @@ BPHandler::~BPHandler()
|
|||||||
|
|
||||||
void BPHandler::MessageReceived(BMessage *message)
|
void BPHandler::MessageReceived(BMessage *message)
|
||||||
{
|
{
|
||||||
Handler_MessageReceived_hook(GetPasObject(), message);
|
MessageReceived_hookCall(message);
|
||||||
|
BHandler::MessageReceived(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPHandler::MessageReceived_hookCall(BMessage *message)
|
||||||
|
{
|
||||||
|
Handler_MessageReceived_hook(GetPasObject(), message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -61,15 +61,33 @@ BPLooper::~BPLooper()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BPLooper::DispatchMessage(BMessage *message, BHandler *target)
|
void BPLooper::DispatchMessage(BMessage *message, BHandler *target)
|
||||||
|
{
|
||||||
|
DispatchMessage_hookCall(message, target);
|
||||||
|
BLooper::DispatchMessage(message, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPLooper::DispatchMessage_hookCall(BMessage *message, BHandler *target)
|
||||||
{
|
{
|
||||||
Looper_DispatchMessage_hook(GetPasObject(), message, target);
|
Looper_DispatchMessage_hook(GetPasObject(), message, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BPLooper::QuitRequested(void)
|
bool BPLooper::QuitRequested(void)
|
||||||
{
|
{
|
||||||
|
QuitRequested_hookCall();
|
||||||
return Looper_QuitRequested_hook(GetPasObject());
|
return Looper_QuitRequested_hook(GetPasObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BPLooper::QuitRequested_hookCall(void)
|
||||||
|
{
|
||||||
|
return Looper_QuitRequested_hook(GetPasObject());
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPLooper::MessageReceived(BMessage *message)
|
||||||
|
{
|
||||||
|
MessageReceived_hookCall(message);
|
||||||
|
BLooper::MessageReceived(message);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -46,7 +46,10 @@ class BPApplication : public BApplication, public virtual BPLooper
|
|||||||
virtual void AppActivated(bool active);
|
virtual void AppActivated(bool active);
|
||||||
virtual void ReadyToRun(void);
|
virtual void ReadyToRun(void);
|
||||||
virtual bool QuitRequested(void);
|
virtual bool QuitRequested(void);
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
virtual void DispatchMessage(BMessage *message, BHandler *target);
|
||||||
|
virtual void AppActivated_hookCall(bool active);
|
||||||
|
virtual void ReadyToRun_hookCall(void);
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,10 @@
|
|||||||
|
|
||||||
#include <beobj.h>
|
#include <beobj.h>
|
||||||
|
|
||||||
|
// definition of callback function in BHandler
|
||||||
|
|
||||||
|
typedef void (*BHandler_MessageReceived_hook) (TPasObject PasObject, TCPlusObject message);
|
||||||
|
|
||||||
class BPHandler : public BHandler, public virtual BPasObject
|
class BPHandler : public BHandler, public virtual BPasObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -30,6 +34,7 @@ class BPHandler : public BHandler, public virtual BPasObject
|
|||||||
BPHandler(TPasObject PasObject, BMessage *archive);
|
BPHandler(TPasObject PasObject, BMessage *archive);
|
||||||
virtual ~BPHandler(void);
|
virtual ~BPHandler(void);
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
virtual void MessageReceived_hookCall(BMessage *message);
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ var
|
|||||||
|
|
||||||
procedure THandler.MessageReceived(aMessage : TMessage);
|
procedure THandler.MessageReceived(aMessage : TMessage);
|
||||||
begin
|
begin
|
||||||
|
WriteLn(ClassName + '.MessageReceived');
|
||||||
WriteLn('Message reçue');
|
WriteLn('Message reçue');
|
||||||
|
aMessage.PrintToStream;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Handler_MessageReceived_hook_func(Handler : THandler; aMessage : TCPlusObject); cdecl;
|
procedure Handler_MessageReceived_hook_func(Handler : THandler; aMessage : TCPlusObject); cdecl;
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ class BPLooper : public BLooper, public virtual BPHandler
|
|||||||
virtual ~BPLooper();
|
virtual ~BPLooper();
|
||||||
virtual void DispatchMessage(BMessage *message, BHandler *target);
|
virtual void DispatchMessage(BMessage *message, BHandler *target);
|
||||||
virtual bool QuitRequested(void);
|
virtual bool QuitRequested(void);
|
||||||
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
virtual void DispatchMessage_hookCall(BMessage *message, BHandler *target);
|
||||||
|
virtual bool QuitRequested_hookCall(void);
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ BButton_MakeDefault_hook Button_MakeDefault_hook;
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class BPButton : public BButton, virtual public BPControl
|
class BPButton : public BButton, virtual public BPControl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// <BView_Constructor>
|
// <BView_Constructor>
|
||||||
@@ -54,7 +54,29 @@ class BPButton : public BButton, virtual public BPControl
|
|||||||
uint32 resizeMask,
|
uint32 resizeMask,
|
||||||
uint32 flags);
|
uint32 flags);
|
||||||
BPButton(TPasObject PasObject, BMessage *archive);
|
BPButton(TPasObject PasObject, BMessage *archive);
|
||||||
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
virtual void Draw(BRect updateRect);
|
||||||
|
virtual void AttachedToWindow(void);
|
||||||
virtual void MakeDefault(bool flag);
|
virtual void MakeDefault(bool flag);
|
||||||
|
virtual void WindowActivated(bool active);
|
||||||
|
|
||||||
|
virtual void AllAttached(void);
|
||||||
|
virtual void AllDetached(void);
|
||||||
|
virtual void DetachedFromWindow(void);
|
||||||
|
virtual void DrawAfterChildren(BRect updateRect);
|
||||||
|
virtual void FrameMoved(BPoint parentPoint);
|
||||||
|
virtual void FrameResized(float width, float height);
|
||||||
|
virtual void GetPreferredSize(float *width, float *height);
|
||||||
|
virtual void ResizeToPreferred(void);
|
||||||
|
virtual void KeyDown(const char *bytes, int32 numBytes);
|
||||||
|
virtual void KeyUp(const char *bytes, int32 numBytes);
|
||||||
|
virtual void MouseDown(BPoint point);
|
||||||
|
virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
|
||||||
|
virtual void MouseUp(BPoint point);
|
||||||
|
virtual void Pulse(void);
|
||||||
|
// virtual void TargetedByScrollView(BScrollView *scroller);
|
||||||
|
virtual void SetEnabled(bool enabled);
|
||||||
|
virtual void SetValue(int32 value);
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -83,11 +105,120 @@ BPButton::BPButton(TPasObject PasObject, BMessage *archive)
|
|||||||
BPHandler(PasObject, archive),
|
BPHandler(PasObject, archive),
|
||||||
BPasObject(PasObject)
|
BPasObject(PasObject)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::MessageReceived(BMessage *message)
|
||||||
|
{
|
||||||
|
MessageReceived_hookCall(message);
|
||||||
|
BButton::MessageReceived(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::Draw(BRect updateRect)
|
||||||
|
{
|
||||||
|
BButton::Draw(updateRect);
|
||||||
|
Draw_hookCall(updateRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::AttachedToWindow(void)
|
||||||
|
{
|
||||||
|
BButton::AttachedToWindow();
|
||||||
|
AttachedToWindow_hookCall();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BPButton::MakeDefault(bool flag)
|
void BPButton::MakeDefault(bool flag)
|
||||||
{
|
{
|
||||||
Button_MakeDefault_hook(GetPasObject(), flag);
|
// Button_MakeDefault_hook(GetPasObject(), flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::WindowActivated(bool active)
|
||||||
|
{
|
||||||
|
BButton::WindowActivated(active);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::AllAttached(void)
|
||||||
|
{
|
||||||
|
BButton::AllAttached();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::AllDetached(void)
|
||||||
|
{
|
||||||
|
BButton::AllDetached();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::DetachedFromWindow(void)
|
||||||
|
{
|
||||||
|
BButton::DetachedFromWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::DrawAfterChildren(BRect updateRect)
|
||||||
|
{
|
||||||
|
BButton::DrawAfterChildren(updateRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::FrameMoved(BPoint parentPoint)
|
||||||
|
{
|
||||||
|
BButton::FrameMoved(parentPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::FrameResized(float width, float height)
|
||||||
|
{
|
||||||
|
BButton::FrameResized(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::GetPreferredSize(float *width, float *height)
|
||||||
|
{
|
||||||
|
BButton::GetPreferredSize(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::ResizeToPreferred(void)
|
||||||
|
{
|
||||||
|
BButton::ResizeToPreferred();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::KeyDown(const char *bytes, int32 numBytes)
|
||||||
|
{
|
||||||
|
BButton::KeyDown(bytes, numBytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::KeyUp(const char *bytes, int32 numBytes)
|
||||||
|
{
|
||||||
|
BButton::KeyUp(bytes, numBytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::MouseDown(BPoint point)
|
||||||
|
{
|
||||||
|
BButton::MouseDown(point);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
|
||||||
|
{
|
||||||
|
BButton::MouseMoved(point, transit, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::MouseUp(BPoint point)
|
||||||
|
{
|
||||||
|
BButton::MouseUp(point);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::Pulse(void)
|
||||||
|
{
|
||||||
|
BButton::Pulse();
|
||||||
|
}
|
||||||
|
|
||||||
|
//void BPButton::TargetedByScrollView(BScrollView *scroller)
|
||||||
|
//{
|
||||||
|
// BButton::TargetedByScrollView(scroller);
|
||||||
|
//}
|
||||||
|
|
||||||
|
void BPButton::SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
BButton::SetEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPButton::SetValue(int32 value)
|
||||||
|
{
|
||||||
|
BButton::SetValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|||||||
@@ -65,6 +65,24 @@ BPControl::BPControl(TPasObject PasObject, BMessage *message):
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BPControl::MessageReceived(BMessage *message)
|
||||||
|
{
|
||||||
|
MessageReceived_hookCall(message);
|
||||||
|
BControl::MessageReceived(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPControl::Draw(BRect updateRect)
|
||||||
|
{
|
||||||
|
BControl::Draw(updateRect);
|
||||||
|
Draw_hookCall(updateRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPControl::AttachedToWindow(void)
|
||||||
|
{
|
||||||
|
BControl::AttachedToWindow();
|
||||||
|
AttachedToWindow_hookCall();
|
||||||
|
}
|
||||||
|
|
||||||
void BPControl::SetEnabled(bool enabled)
|
void BPControl::SetEnabled(bool enabled)
|
||||||
{
|
{
|
||||||
Control_SetEnabled_hook(GetPasObject(), enabled);
|
Control_SetEnabled_hook(GetPasObject(), enabled);
|
||||||
|
|||||||
@@ -106,6 +106,12 @@ BPView::BPView(TPasObject PasObject, BMessage *archive)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BPView::MessageReceived(BMessage *message)
|
||||||
|
{
|
||||||
|
MessageReceived_hookCall(message);
|
||||||
|
BView::MessageReceived(message);
|
||||||
|
}
|
||||||
|
|
||||||
void BPView::AllAttached(void)
|
void BPView::AllAttached(void)
|
||||||
{
|
{
|
||||||
View_AllAttached_hook(GetPasObject());
|
View_AllAttached_hook(GetPasObject());
|
||||||
@@ -113,7 +119,13 @@ void BPView::AllAttached(void)
|
|||||||
|
|
||||||
void BPView::AttachedToWindow(void)
|
void BPView::AttachedToWindow(void)
|
||||||
{
|
{
|
||||||
View_AttachedToWindow_hook(GetPasObject());
|
BView::AttachedToWindow();
|
||||||
|
AttachedToWindow_hookCall();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPView::AttachedToWindow_hookCall(void)
|
||||||
|
{
|
||||||
|
View_AttachedToWindow_hook(GetPasObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BPView::AllDetached(void)
|
void BPView::AllDetached(void)
|
||||||
@@ -129,6 +141,11 @@ void BPView::DetachedFromWindow(void)
|
|||||||
void BPView::Draw(BRect updateRect)
|
void BPView::Draw(BRect updateRect)
|
||||||
{
|
{
|
||||||
BView::Draw(updateRect);
|
BView::Draw(updateRect);
|
||||||
|
Draw_hookCall(updateRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BPView::Draw_hookCall(BRect updateRect)
|
||||||
|
{
|
||||||
View_Draw_hook(GetPasObject(), &updateRect);
|
View_Draw_hook(GetPasObject(), &updateRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -147,27 +147,27 @@ end;
|
|||||||
|
|
||||||
procedure TButton.Draw(updateRect : TRect);
|
procedure TButton.Draw(updateRect : TRect);
|
||||||
begin
|
begin
|
||||||
BButton_Draw(CPlusObject, updateRect.CPlusObject);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.MouseDown(where : TPoint);
|
procedure TButton.MouseDown(where : TPoint);
|
||||||
begin
|
begin
|
||||||
BButton_MouseDown(CPlusObject, where.CPlusObject);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.AttachedToWindow;
|
procedure TButton.AttachedToWindow;
|
||||||
begin
|
begin
|
||||||
BButton_AttachedToWindow(CPlusObject);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.KeyDown(bytes : PChar; numBytes : integer);
|
procedure TButton.KeyDown(bytes : PChar; numBytes : integer);
|
||||||
begin
|
begin
|
||||||
BButton_KeyDown(CPlusObject, bytes, numBytes);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.MakeDefault(state : boolean);
|
procedure TButton.MakeDefault(state : boolean);
|
||||||
begin
|
begin
|
||||||
BButton_MakeDefault(CPlusObject, state);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.SetLabel(text : PChar);
|
procedure TButton.SetLabel(text : PChar);
|
||||||
@@ -188,37 +188,37 @@ end;
|
|||||||
|
|
||||||
procedure TButton.WindowActivated(state : boolean);
|
procedure TButton.WindowActivated(state : boolean);
|
||||||
begin
|
begin
|
||||||
BButton_WindowActivated(CPlusObject, state);
|
// BButton_WindowActivated(CPlusObject, state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.MouseUp(pt : TPoint);
|
procedure TButton.MouseUp(pt : TPoint);
|
||||||
begin
|
begin
|
||||||
BButton_MouseUp(CPlusObject, pt.CPlusObject);
|
// BButton_MouseUp(CPlusObject, pt.CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);
|
procedure TButton.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);
|
||||||
begin
|
begin
|
||||||
BButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
// BButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.DetachedFromWindow;
|
procedure TButton.DetachedFromWindow;
|
||||||
begin
|
begin
|
||||||
BButton_DetachedFromWindow(CPlusObject);
|
// BButton_DetachedFromWindow(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.SetValue(aValue : integer);
|
procedure TButton.SetValue(aValue : integer);
|
||||||
begin
|
begin
|
||||||
BButton_SetValue(CPlusObject, aValue);
|
// BButton_SetValue(CPlusObject, aValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.GetPreferredSize(width : double; height : double);
|
procedure TButton.GetPreferredSize(width : double; height : double);
|
||||||
begin
|
begin
|
||||||
BButton_GetPreferredSize(CPlusObject, width, height);
|
// BButton_GetPreferredSize(CPlusObject, width, height);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.ResizeToPreferred;
|
procedure TButton.ResizeToPreferred;
|
||||||
begin
|
begin
|
||||||
BButton_ResizeToPreferred(CPlusObject);
|
// BButton_ResizeToPreferred(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TButton.Invoke(msg : TMessage) : TStatus_t;
|
function TButton.Invoke(msg : TMessage) : TStatus_t;
|
||||||
@@ -228,12 +228,12 @@ end;
|
|||||||
|
|
||||||
procedure TButton.FrameMoved(new_position : TPoint);
|
procedure TButton.FrameMoved(new_position : TPoint);
|
||||||
begin
|
begin
|
||||||
BButton_FrameMoved(CPlusObject, new_position.CPlusObject);
|
// BButton_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.FrameResized(new_width : double; new_height : double);
|
procedure TButton.FrameResized(new_width : double; new_height : double);
|
||||||
begin
|
begin
|
||||||
BButton_FrameResized(CPlusObject, new_width, new_height);
|
// BButton_FrameResized(CPlusObject, new_width, new_height);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.MakeFocus(state : boolean);
|
procedure TButton.MakeFocus(state : boolean);
|
||||||
@@ -243,12 +243,12 @@ end;
|
|||||||
|
|
||||||
procedure TButton.AllAttached;
|
procedure TButton.AllAttached;
|
||||||
begin
|
begin
|
||||||
BButton_AllAttached(CPlusObject);
|
// BButton_AllAttached(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButton.AllDetached;
|
procedure TButton.AllDetached;
|
||||||
begin
|
begin
|
||||||
BButton_AllDetached(CPlusObject);
|
// BButton_AllDetached(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TButton.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler;
|
function TButton.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler;
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ class BPControl : public BControl, virtual public BPView
|
|||||||
uint32 resizeMask,
|
uint32 resizeMask,
|
||||||
uint32 flags);
|
uint32 flags);
|
||||||
BPControl(TPasObject PasObject, BMessage *message);
|
BPControl(TPasObject PasObject, BMessage *message);
|
||||||
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
virtual void Draw(BRect updateRect);
|
||||||
|
virtual void AttachedToWindow(void);
|
||||||
virtual void SetEnabled(bool enabled);
|
virtual void SetEnabled(bool enabled);
|
||||||
virtual void SetValue(int32 value);
|
virtual void SetValue(int32 value);
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -156,47 +156,47 @@ end;
|
|||||||
|
|
||||||
procedure TControl.WindowActivated(state : boolean);
|
procedure TControl.WindowActivated(state : boolean);
|
||||||
begin
|
begin
|
||||||
BControl_WindowActivated(CPlusObject, state);
|
// BControl_WindowActivated(CPlusObject, state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.AttachedToWindow;
|
procedure TControl.AttachedToWindow;
|
||||||
begin
|
begin
|
||||||
BControl_AttachedToWindow(CPlusObject);
|
// BControl_AttachedToWindow(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.MessageReceived(msg : TMessage);
|
procedure TControl.MessageReceived(msg : TMessage);
|
||||||
begin
|
begin
|
||||||
BControl_MessageReceived(CPlusObject, msg.CPlusObject);
|
// BControl_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.MakeFocus(state : boolean);
|
procedure TControl.MakeFocus(state : boolean);
|
||||||
begin
|
begin
|
||||||
BControl_MakeFocus(CPlusObject, state);
|
// BControl_MakeFocus(CPlusObject, state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.KeyDown(bytes : PChar; numBytes : integer);
|
procedure TControl.KeyDown(bytes : PChar; numBytes : integer);
|
||||||
begin
|
begin
|
||||||
BControl_KeyDown(CPlusObject, bytes, numBytes);
|
// BControl_KeyDown(CPlusObject, bytes, numBytes);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.MouseDown(pt : TPoint);
|
procedure TControl.MouseDown(pt : TPoint);
|
||||||
begin
|
begin
|
||||||
BControl_MouseDown(CPlusObject, pt.CPlusObject);
|
// BControl_MouseDown(CPlusObject, pt.CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.MouseUp(pt : TPoint);
|
procedure TControl.MouseUp(pt : TPoint);
|
||||||
begin
|
begin
|
||||||
BControl_MouseUp(CPlusObject, pt.CPlusObject);
|
// BControl_MouseUp(CPlusObject, pt.CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);
|
procedure TControl.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);
|
||||||
begin
|
begin
|
||||||
BControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
// BControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.DetachedFromWindow;
|
procedure TControl.DetachedFromWindow;
|
||||||
begin
|
begin
|
||||||
BControl_DetachedFromWindow(CPlusObject);
|
// BControl_DetachedFromWindow(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.SetLabel(text : PChar);
|
procedure TControl.SetLabel(text : PChar);
|
||||||
@@ -231,12 +231,12 @@ end;
|
|||||||
|
|
||||||
procedure TControl.GetPreferredSize(width : double; height : double);
|
procedure TControl.GetPreferredSize(width : double; height : double);
|
||||||
begin
|
begin
|
||||||
BControl_GetPreferredSize(CPlusObject, width, height);
|
// BControl_GetPreferredSize(CPlusObject, width, height);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.ResizeToPreferred;
|
procedure TControl.ResizeToPreferred;
|
||||||
begin
|
begin
|
||||||
BControl_ResizeToPreferred(CPlusObject);
|
// BControl_ResizeToPreferred(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TControl.Invoke(msg : TMessage) : TStatus_t;
|
function TControl.Invoke(msg : TMessage) : TStatus_t;
|
||||||
@@ -256,12 +256,12 @@ end;
|
|||||||
|
|
||||||
procedure TControl.AllAttached;
|
procedure TControl.AllAttached;
|
||||||
begin
|
begin
|
||||||
BControl_AllAttached(CPlusObject);
|
// BControl_AllAttached(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.AllDetached;
|
procedure TControl.AllDetached;
|
||||||
begin
|
begin
|
||||||
BControl_AllDetached(CPlusObject);
|
// BControl_AllDetached(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TControl.Perform(d : TPerform_code; arg : Pointer) : TStatus_t;
|
function TControl.Perform(d : TPerform_code; arg : Pointer) : TStatus_t;
|
||||||
|
|||||||
@@ -11,9 +11,10 @@ type
|
|||||||
blue : byte;
|
blue : byte;
|
||||||
alpha : byte;
|
alpha : byte;
|
||||||
end;
|
end;
|
||||||
|
TColor_space = Cardinal;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@@ -35,8 +35,7 @@ class BPView : public BView, public virtual BPHandler
|
|||||||
uint32 resizingMode,
|
uint32 resizingMode,
|
||||||
uint32 flags);
|
uint32 flags);
|
||||||
BPView(TPasObject PasObject, BMessage *archive);
|
BPView(TPasObject PasObject, BMessage *archive);
|
||||||
// virtual void DispatchMessage(BMessage *message, BHandler *target);
|
virtual void MessageReceived(BMessage *message);
|
||||||
// virtual bool QuitRequested(void);
|
|
||||||
virtual void AllAttached(void);
|
virtual void AllAttached(void);
|
||||||
virtual void AttachedToWindow(void);
|
virtual void AttachedToWindow(void);
|
||||||
virtual void AllDetached(void);
|
virtual void AllDetached(void);
|
||||||
@@ -55,6 +54,8 @@ class BPView : public BView, public virtual BPHandler
|
|||||||
virtual void Pulse(void);
|
virtual void Pulse(void);
|
||||||
// virtual void TargetedByScrollView(BScrollView *scroller);
|
// virtual void TargetedByScrollView(BScrollView *scroller);
|
||||||
virtual void WindowActivated(bool active);
|
virtual void WindowActivated(bool active);
|
||||||
|
virtual void Draw_hookCall(BRect updateRect);
|
||||||
|
virtual void AttachedToWindow_hookCall(void);
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ type
|
|||||||
procedure Pulse; virtual;
|
procedure Pulse; virtual;
|
||||||
// procedure TargetedByScrollView(scroller : TScrollView); virtual; // Need BScrollView
|
// procedure TargetedByScrollView(scroller : TScrollView); virtual; // Need BScrollView
|
||||||
procedure WindowActivated(active : boolean); virtual;
|
procedure WindowActivated(active : boolean); virtual;
|
||||||
|
procedure MessageReceived(aMessage : TMessage); override;
|
||||||
// End hook functions
|
// End hook functions
|
||||||
function RemoveSelf : boolean;
|
function RemoveSelf : boolean;
|
||||||
procedure AddChild(aView, before : TView);
|
procedure AddChild(aView, before : TView);
|
||||||
@@ -94,16 +95,16 @@ var
|
|||||||
|
|
||||||
const
|
const
|
||||||
// flags
|
// flags
|
||||||
B_FULL_UPDATE_ON_RESIZE : Cardinal = 31;
|
B_FULL_UPDATE_ON_RESIZE : Cardinal = $80000000;//31;
|
||||||
_B_RESERVED1_ : Cardinal = 30;
|
_B_RESERVED1_ : Cardinal = $40000000;//30;
|
||||||
B_WILL_DRAW : Cardinal = 29;
|
B_WILL_DRAW : Cardinal = $20000000;//29;
|
||||||
B_PULSE_NEEDED : Cardinal = 28;
|
B_PULSE_NEEDED : Cardinal = $10000000;//28;
|
||||||
B_NAVIGABLE_JUMP : Cardinal = 27;
|
B_NAVIGABLE_JUMP : Cardinal = $08000000;//27;
|
||||||
B_FRAME_EVENTS : Cardinal = 26;
|
B_FRAME_EVENTS : Cardinal = $04000000;//26;
|
||||||
B_NAVIGABLE : Cardinal = 25;
|
B_NAVIGABLE : Cardinal = $02000000;//25;
|
||||||
B_SUBPIXEL_PRECISE : Cardinal = 24;
|
B_SUBPIXEL_PRECISE : Cardinal = $00800000;//24;
|
||||||
B_DRAW_ON_CHILDREN : Cardinal = 23;
|
B_DRAW_ON_CHILDREN : Cardinal = $00400000;//23;
|
||||||
_B_RESERVED7_ : Cardinal = 22;
|
_B_RESERVED7_ : Cardinal = $00200000;//22;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@@ -234,9 +235,14 @@ end;
|
|||||||
|
|
||||||
procedure TView.WindowActivated(active : boolean);
|
procedure TView.WindowActivated(active : boolean);
|
||||||
begin
|
begin
|
||||||
Writeln('WindowActivated in View');
|
// WriteLn('WindowActivated in View');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TView.MessageReceived(aMessage : TMessage);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
WriteLn('View.MessageReceived, PASCAL');
|
||||||
|
end;
|
||||||
|
|
||||||
function TView.RemoveSelf : boolean;
|
function TView.RemoveSelf : boolean;
|
||||||
begin
|
begin
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., s59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _WINDOW_H_
|
#ifndef _WINDOW_H_
|
||||||
@@ -36,8 +36,10 @@ class BPWindow : public BWindow, public BPLooper
|
|||||||
window_type type,
|
window_type type,
|
||||||
uint32 flags,
|
uint32 flags,
|
||||||
uint32 workspaces = B_CURRENT_WORKSPACE);
|
uint32 workspaces = B_CURRENT_WORKSPACE);
|
||||||
// virtual void DispatchMessage(BMessage *message, BHandler *target);
|
virtual void MessageReceived(BMessage *message);
|
||||||
// virtual bool QuitRequested(void);
|
virtual void DispatchMessage(BMessage *message, BHandler *target);
|
||||||
|
virtual bool QuitRequested(void);
|
||||||
|
virtual void WindowActivated(bool active);
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,9 @@ unit os;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SupportDefs;
|
||||||
|
|
||||||
const
|
const
|
||||||
B_LOW_LATENCY = 5;
|
B_LOW_LATENCY = 5;
|
||||||
B_LOW_PRIORITY = 5;
|
B_LOW_PRIORITY = 5;
|
||||||
@@ -42,6 +45,48 @@ type
|
|||||||
TThread_id = Longint;
|
TThread_id = Longint;
|
||||||
TTeam_id = Longint;
|
TTeam_id = Longint;
|
||||||
|
|
||||||
|
const
|
||||||
|
B_NO_LOCK = 0;
|
||||||
|
B_LAZY_LOCK = 1;
|
||||||
|
B_FULL_LOCK = 2;
|
||||||
|
B_CONTIGUOUS = 3;
|
||||||
|
B_LOMEM = 4;
|
||||||
|
|
||||||
|
B_ANY_ADDRESS = 0;
|
||||||
|
B_EXACT_ADDRESS = 1;
|
||||||
|
B_BASE_ADDRESS = 2;
|
||||||
|
B_CLONE_ADDRESS = 3;
|
||||||
|
B_ANY_KERNEL_ADDRESS = 4;
|
||||||
|
|
||||||
|
B_READ_AREA = 1;
|
||||||
|
B_WRITE_AREA = 2;
|
||||||
|
|
||||||
|
// area
|
||||||
|
type
|
||||||
|
TArea_Info = record
|
||||||
|
area : TArea_id;
|
||||||
|
name : array [0..B_OS_NAME_LENGTH] of char;
|
||||||
|
size : TSize_t;
|
||||||
|
lock : Cardinal;
|
||||||
|
protection : Cardinal;
|
||||||
|
team : TTeam_id;
|
||||||
|
ram_size : Cardinal;
|
||||||
|
copy_count : Cardinal;
|
||||||
|
in_count : Cardinal;
|
||||||
|
out_count : Cardinal;
|
||||||
|
address : Pointer;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Semaphores
|
||||||
|
type
|
||||||
|
TSem_Info = record
|
||||||
|
sem : TSem_id;
|
||||||
|
team : TTeam_id;
|
||||||
|
name : array [0..B_OS_NAME_LENGTH] of char;
|
||||||
|
count : integer;
|
||||||
|
latest_holder : TThread_id;
|
||||||
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
end.
|
end.
|
||||||
Binary file not shown.
@@ -36,8 +36,9 @@ type
|
|||||||
aView : TView;
|
aView : TView;
|
||||||
aButton : TButton;
|
aButton : TButton;
|
||||||
public
|
public
|
||||||
constructor Create(frame : TRect; title : PChar; atype, flags, workspaces : Cardinal); override;
|
constructor Create(aFrame : TRect; title : PChar; atype, aFlags, aWorkspaces : Cardinal); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure MessageReceived(amessage : TMessage); override;
|
||||||
end;
|
end;
|
||||||
TMonObjet = class(TObject)
|
TMonObjet = class(TObject)
|
||||||
private
|
private
|
||||||
@@ -53,7 +54,7 @@ type
|
|||||||
var
|
var
|
||||||
MonObj : TMonObjet;
|
MonObj : TMonObjet;
|
||||||
|
|
||||||
constructor TMyWindow.Create(frame : TRect; title : PChar; atype, flags, workspaces : Cardinal);
|
constructor TMyWindow.Create(aFrame : TRect; title : PChar; atype, aFlags, aWorkspaces : Cardinal);
|
||||||
var
|
var
|
||||||
aRect, aRect2 : TRect;
|
aRect, aRect2 : TRect;
|
||||||
rgb_color : TRGB_color;
|
rgb_color : TRGB_color;
|
||||||
@@ -62,23 +63,24 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
aRect := TRect.Create(20, 20, 100, 100);
|
aRect := TRect.Create(20, 20, 100, 100);
|
||||||
try
|
try
|
||||||
aRect2 := TRect.Create(120, 120, 300, 300);
|
aRect2 := TRect.Create(110, 110, 150, 150);
|
||||||
try
|
try
|
||||||
aView := TView.Create(aRect, 'Test', B_FOLLOW_NONE, B_WILL_DRAW);
|
aView := TView.Create(aRect, 'Test', B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
rgb_color.red := 255;
|
rgb_color.red := 255;
|
||||||
rgb_color.green := 0;
|
rgb_color.green := 0;
|
||||||
rgb_color.blue := 0;
|
rgb_color.blue := 0;
|
||||||
rgb_color.alpha := 0;
|
rgb_color.alpha := 0;
|
||||||
aView.SetViewColor(rgb_color);
|
aView.SetViewColor(rgb_color);
|
||||||
Self.AddChild(aView, nil);
|
Self.AddChild(aView, nil);
|
||||||
mess := TMessage.Create(100);
|
mess := TMessage.Create(77777);
|
||||||
aButton := TButton.Create(aRect2, 'Test', 'Test', mess, B_FOLLOW_NONE, B_WILL_DRAW);
|
aButton := TButton.Create(aRect2, 'Test2', 'Test2', mess, B_FOLLOW_LEFT or B_FOLLOW_TOP, B_WILL_DRAW or B_NAVIGABLE);
|
||||||
|
aButton.SetViewColor(rgb_color);
|
||||||
WriteLn('before addchild');
|
WriteLn('before addchild');
|
||||||
Self.AddChild(aButton, nil);
|
Self.AddChild(aButton, nil);
|
||||||
aButton.Invoker.SetTarget(aView, nil);
|
WriteLn('after addchild');
|
||||||
|
// aButton.Invoker.SetTarget(aView, nil);
|
||||||
if aButton.IsEnabled then
|
if aButton.IsEnabled then
|
||||||
WriteLn('Actif');
|
WriteLn('Actif');
|
||||||
WriteLn('after addchild');
|
|
||||||
finally
|
finally
|
||||||
aRect2.Free;
|
aRect2.Free;
|
||||||
end;
|
end;
|
||||||
@@ -94,6 +96,13 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMyWindow.MessageReceived(aMessage : TMessage);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
WriteLn('TMyWindow réception');
|
||||||
|
WriteLn(Self.ClassName + '.MessageReceived');
|
||||||
|
end;
|
||||||
|
|
||||||
function TMonApplication.QuitRequested : boolean;
|
function TMonApplication.QuitRequested : boolean;
|
||||||
begin
|
begin
|
||||||
Result := inherited;
|
Result := inherited;
|
||||||
|
|||||||
Reference in New Issue
Block a user