BButton is now wrapped ! Be GUI apps in pascal are comming soon.
This commit is contained in:
@@ -42,7 +42,7 @@ BButton_MakeDefault_hook Button_MakeDefault_hook;
|
||||
}
|
||||
#endif
|
||||
|
||||
class BPButton : public BButton, virtual public BPControl
|
||||
class BPButton : public BButton, virtual public BPControl
|
||||
{
|
||||
public:
|
||||
// <BView_Constructor>
|
||||
@@ -54,7 +54,29 @@ class BPButton : public BButton, virtual public BPControl
|
||||
uint32 resizeMask,
|
||||
uint32 flags);
|
||||
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 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:
|
||||
};
|
||||
|
||||
@@ -83,11 +105,120 @@ BPButton::BPButton(TPasObject PasObject, BMessage *archive)
|
||||
BPHandler(PasObject, archive),
|
||||
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)
|
||||
{
|
||||
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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
View_AllAttached_hook(GetPasObject());
|
||||
@@ -113,7 +119,13 @@ void BPView::AllAttached(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)
|
||||
@@ -129,6 +141,11 @@ void BPView::DetachedFromWindow(void)
|
||||
void BPView::Draw(BRect updateRect)
|
||||
{
|
||||
BView::Draw(updateRect);
|
||||
Draw_hookCall(updateRect);
|
||||
}
|
||||
|
||||
void BPView::Draw_hookCall(BRect 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);
|
||||
begin
|
||||
BButton_Draw(CPlusObject, updateRect.CPlusObject);
|
||||
|
||||
end;
|
||||
|
||||
procedure TButton.MouseDown(where : TPoint);
|
||||
begin
|
||||
BButton_MouseDown(CPlusObject, where.CPlusObject);
|
||||
|
||||
end;
|
||||
|
||||
procedure TButton.AttachedToWindow;
|
||||
begin
|
||||
BButton_AttachedToWindow(CPlusObject);
|
||||
|
||||
end;
|
||||
|
||||
procedure TButton.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
BButton_KeyDown(CPlusObject, bytes, numBytes);
|
||||
|
||||
end;
|
||||
|
||||
procedure TButton.MakeDefault(state : boolean);
|
||||
begin
|
||||
BButton_MakeDefault(CPlusObject, state);
|
||||
|
||||
end;
|
||||
|
||||
procedure TButton.SetLabel(text : PChar);
|
||||
@@ -188,37 +188,37 @@ end;
|
||||
|
||||
procedure TButton.WindowActivated(state : boolean);
|
||||
begin
|
||||
BButton_WindowActivated(CPlusObject, state);
|
||||
// BButton_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure TButton.MouseUp(pt : TPoint);
|
||||
begin
|
||||
BButton_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
// BButton_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);
|
||||
begin
|
||||
BButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
// BButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure TButton.DetachedFromWindow;
|
||||
begin
|
||||
BButton_DetachedFromWindow(CPlusObject);
|
||||
// BButton_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.SetValue(aValue : integer);
|
||||
begin
|
||||
BButton_SetValue(CPlusObject, aValue);
|
||||
// BButton_SetValue(CPlusObject, aValue);
|
||||
end;
|
||||
|
||||
procedure TButton.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BButton_GetPreferredSize(CPlusObject, width, height);
|
||||
// BButton_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure TButton.ResizeToPreferred;
|
||||
begin
|
||||
BButton_ResizeToPreferred(CPlusObject);
|
||||
// BButton_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
function TButton.Invoke(msg : TMessage) : TStatus_t;
|
||||
@@ -228,12 +228,12 @@ end;
|
||||
|
||||
procedure TButton.FrameMoved(new_position : TPoint);
|
||||
begin
|
||||
BButton_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
// BButton_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
BButton_FrameResized(CPlusObject, new_width, new_height);
|
||||
// BButton_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
procedure TButton.MakeFocus(state : boolean);
|
||||
@@ -243,12 +243,12 @@ end;
|
||||
|
||||
procedure TButton.AllAttached;
|
||||
begin
|
||||
BButton_AllAttached(CPlusObject);
|
||||
// BButton_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.AllDetached;
|
||||
begin
|
||||
BButton_AllDetached(CPlusObject);
|
||||
// BButton_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
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 flags);
|
||||
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 SetValue(int32 value);
|
||||
private:
|
||||
|
||||
@@ -156,47 +156,47 @@ end;
|
||||
|
||||
procedure TControl.WindowActivated(state : boolean);
|
||||
begin
|
||||
BControl_WindowActivated(CPlusObject, state);
|
||||
// BControl_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure TControl.AttachedToWindow;
|
||||
begin
|
||||
BControl_AttachedToWindow(CPlusObject);
|
||||
// BControl_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.MessageReceived(msg : TMessage);
|
||||
begin
|
||||
BControl_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
// BControl_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.MakeFocus(state : boolean);
|
||||
begin
|
||||
BControl_MakeFocus(CPlusObject, state);
|
||||
// BControl_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure TControl.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
BControl_KeyDown(CPlusObject, bytes, numBytes);
|
||||
// BControl_KeyDown(CPlusObject, bytes, numBytes);
|
||||
end;
|
||||
|
||||
procedure TControl.MouseDown(pt : TPoint);
|
||||
begin
|
||||
BControl_MouseDown(CPlusObject, pt.CPlusObject);
|
||||
// BControl_MouseDown(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.MouseUp(pt : TPoint);
|
||||
begin
|
||||
BControl_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
// BControl_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);
|
||||
begin
|
||||
BControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
// BControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure TControl.DetachedFromWindow;
|
||||
begin
|
||||
BControl_DetachedFromWindow(CPlusObject);
|
||||
// BControl_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.SetLabel(text : PChar);
|
||||
@@ -231,12 +231,12 @@ end;
|
||||
|
||||
procedure TControl.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BControl_GetPreferredSize(CPlusObject, width, height);
|
||||
// BControl_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure TControl.ResizeToPreferred;
|
||||
begin
|
||||
BControl_ResizeToPreferred(CPlusObject);
|
||||
// BControl_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
function TControl.Invoke(msg : TMessage) : TStatus_t;
|
||||
@@ -256,12 +256,12 @@ end;
|
||||
|
||||
procedure TControl.AllAttached;
|
||||
begin
|
||||
BControl_AllAttached(CPlusObject);
|
||||
// BControl_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.AllDetached;
|
||||
begin
|
||||
BControl_AllDetached(CPlusObject);
|
||||
// BControl_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
function TControl.Perform(d : TPerform_code; arg : Pointer) : TStatus_t;
|
||||
|
||||
@@ -11,9 +11,10 @@ type
|
||||
blue : byte;
|
||||
alpha : byte;
|
||||
end;
|
||||
|
||||
TColor_space = Cardinal;
|
||||
|
||||
implementation
|
||||
|
||||
initialization
|
||||
|
||||
end.
|
||||
end.
|
||||
|
||||
@@ -35,8 +35,7 @@ class BPView : public BView, public virtual BPHandler
|
||||
uint32 resizingMode,
|
||||
uint32 flags);
|
||||
BPView(TPasObject PasObject, BMessage *archive);
|
||||
// virtual void DispatchMessage(BMessage *message, BHandler *target);
|
||||
// virtual bool QuitRequested(void);
|
||||
virtual void MessageReceived(BMessage *message);
|
||||
virtual void AllAttached(void);
|
||||
virtual void AttachedToWindow(void);
|
||||
virtual void AllDetached(void);
|
||||
@@ -55,6 +54,8 @@ class BPView : public BView, public virtual BPHandler
|
||||
virtual void Pulse(void);
|
||||
// virtual void TargetedByScrollView(BScrollView *scroller);
|
||||
virtual void WindowActivated(bool active);
|
||||
virtual void Draw_hookCall(BRect updateRect);
|
||||
virtual void AttachedToWindow_hookCall(void);
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ type
|
||||
procedure Pulse; virtual;
|
||||
// procedure TargetedByScrollView(scroller : TScrollView); virtual; // Need BScrollView
|
||||
procedure WindowActivated(active : boolean); virtual;
|
||||
procedure MessageReceived(aMessage : TMessage); override;
|
||||
// End hook functions
|
||||
function RemoveSelf : boolean;
|
||||
procedure AddChild(aView, before : TView);
|
||||
@@ -94,16 +95,16 @@ var
|
||||
|
||||
const
|
||||
// flags
|
||||
B_FULL_UPDATE_ON_RESIZE : Cardinal = 31;
|
||||
_B_RESERVED1_ : Cardinal = 30;
|
||||
B_WILL_DRAW : Cardinal = 29;
|
||||
B_PULSE_NEEDED : Cardinal = 28;
|
||||
B_NAVIGABLE_JUMP : Cardinal = 27;
|
||||
B_FRAME_EVENTS : Cardinal = 26;
|
||||
B_NAVIGABLE : Cardinal = 25;
|
||||
B_SUBPIXEL_PRECISE : Cardinal = 24;
|
||||
B_DRAW_ON_CHILDREN : Cardinal = 23;
|
||||
_B_RESERVED7_ : Cardinal = 22;
|
||||
B_FULL_UPDATE_ON_RESIZE : Cardinal = $80000000;//31;
|
||||
_B_RESERVED1_ : Cardinal = $40000000;//30;
|
||||
B_WILL_DRAW : Cardinal = $20000000;//29;
|
||||
B_PULSE_NEEDED : Cardinal = $10000000;//28;
|
||||
B_NAVIGABLE_JUMP : Cardinal = $08000000;//27;
|
||||
B_FRAME_EVENTS : Cardinal = $04000000;//26;
|
||||
B_NAVIGABLE : Cardinal = $02000000;//25;
|
||||
B_SUBPIXEL_PRECISE : Cardinal = $00800000;//24;
|
||||
B_DRAW_ON_CHILDREN : Cardinal = $00400000;//23;
|
||||
_B_RESERVED7_ : Cardinal = $00200000;//22;
|
||||
|
||||
implementation
|
||||
|
||||
@@ -234,9 +235,14 @@ end;
|
||||
|
||||
procedure TView.WindowActivated(active : boolean);
|
||||
begin
|
||||
Writeln('WindowActivated in View');
|
||||
// WriteLn('WindowActivated in View');
|
||||
end;
|
||||
|
||||
procedure TView.MessageReceived(aMessage : TMessage);
|
||||
begin
|
||||
inherited;
|
||||
WriteLn('View.MessageReceived, PASCAL');
|
||||
end;
|
||||
|
||||
function TView.RemoveSelf : boolean;
|
||||
begin
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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_
|
||||
@@ -36,8 +36,10 @@ class BPWindow : public BWindow, public BPLooper
|
||||
window_type type,
|
||||
uint32 flags,
|
||||
uint32 workspaces = B_CURRENT_WORKSPACE);
|
||||
// virtual void DispatchMessage(BMessage *message, BHandler *target);
|
||||
// virtual bool QuitRequested(void);
|
||||
virtual void MessageReceived(BMessage *message);
|
||||
virtual void DispatchMessage(BMessage *message, BHandler *target);
|
||||
virtual bool QuitRequested(void);
|
||||
virtual void WindowActivated(bool active);
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user