Fixes and start of BButton support. GUI is comming !
This commit is contained in:
555
bepascal/bepascal/be/interface/Button.cpp
Normal file
555
bepascal/bepascal/be/interface/Button.cpp
Normal file
@@ -0,0 +1,555 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#ifndef _BUTTON_CPP_
|
||||
#define _BUTTON_CPP_
|
||||
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: Button.cpp
|
||||
* DATE: Tue Dec 3 00:28:35 2002
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "Button.h"
|
||||
|
||||
#include "control.h"
|
||||
#include <beobj.h>
|
||||
|
||||
typedef void (*BButton_MakeDefault_hook) (TPasObject PasObject, bool flag);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
BButton_MakeDefault_hook Button_MakeDefault_hook;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
class BPButton : public BButton, virtual public BPControl
|
||||
{
|
||||
public:
|
||||
// <BView_Constructor>
|
||||
BPButton(TPasObject PasObject,
|
||||
BRect frame,
|
||||
const char *name,
|
||||
const char *label,
|
||||
BMessage *message,
|
||||
uint32 resizeMask,
|
||||
uint32 flags);
|
||||
BPButton(TPasObject PasObject, BMessage *archive);
|
||||
virtual void MakeDefault(bool flag);
|
||||
private:
|
||||
};
|
||||
|
||||
BPButton::BPButton(TPasObject PasObject, BRect frame,
|
||||
const char *name,
|
||||
const char *label,
|
||||
BMessage *message,
|
||||
uint32 resizeMask,
|
||||
uint32 flags)
|
||||
:
|
||||
BButton(frame, name, label, message,
|
||||
resizeMask, flags),
|
||||
BPControl(PasObject, frame, name, label, message,
|
||||
resizeMask, flags),
|
||||
BPView(PasObject, frame, name, resizeMask, flags),
|
||||
BPHandler(PasObject, name),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BPButton::BPButton(TPasObject PasObject, BMessage *archive)
|
||||
:BButton(archive),
|
||||
BPControl(PasObject, archive),
|
||||
BPView(PasObject, archive),
|
||||
BPHandler(PasObject, archive),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
void BPButton::MakeDefault(bool flag)
|
||||
{
|
||||
Button_MakeDefault_hook(GetPasObject(), flag);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::~BButton
|
||||
* Params:
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void BButton_Free(BButton *Button)
|
||||
{
|
||||
delete Button;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::BButton
|
||||
* Params:
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
TCPlusObject BButton_Create(TPasObject PasObject, BRect frame,
|
||||
const char *name,
|
||||
const char *label,
|
||||
BMessage *message,
|
||||
uint32 resizeMask,
|
||||
uint32 flags)
|
||||
{
|
||||
return new BPButton(PasObject, frame, name, label, message, resizeMask, flags);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::BButton
|
||||
* Params: BMessage *data
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
TCPlusObject BButton_Create_1(TPasObject PasObject, BMessage *data)
|
||||
{
|
||||
return new BPButton(PasObject, data);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::Instantiate
|
||||
* Params: BMessage *data
|
||||
* Returns: BArchivable *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
BArchivable *
|
||||
BButton_Instantiate(BButton *Button, BMessage *data)
|
||||
{
|
||||
return Button->Instantiate(data);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::Archive
|
||||
* Params: BMessage *data, bool deep
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BButton_Archive(BButton *Button, BMessage *data, bool deep)
|
||||
{
|
||||
return Button->Archive(data, deep);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::Draw
|
||||
* Params: BRect updateRect
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_Draw(BButton *Button, BRect updateRect)
|
||||
{
|
||||
Button->Draw(updateRect);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::MouseDown
|
||||
* Params: BPoint where
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_MouseDown(BButton *Button, BPoint where)
|
||||
{
|
||||
Button->MouseDown(where);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::AttachedToWindow
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_AttachedToWindow(BButton *Button)
|
||||
{
|
||||
Button->AttachedToWindow();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::KeyDown
|
||||
* Params: const char *bytes, int32 numBytes
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_KeyDown(BButton *Button, const char *bytes, int32 numBytes)
|
||||
{
|
||||
Button->KeyDown(bytes, numBytes);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::MakeDefault
|
||||
* Params: bool state
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_MakeDefault(BButton *Button, bool state)
|
||||
{
|
||||
Button->MakeDefault(state);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::SetLabel
|
||||
* Params: const char *text
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_SetLabel(BButton *Button, const char *text)
|
||||
{
|
||||
Button->SetLabel(text);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::IsDefault
|
||||
* Params:
|
||||
* Returns: bool
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
bool
|
||||
BButton_IsDefault(BButton *Button)
|
||||
{
|
||||
return Button->IsDefault();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::MessageReceived
|
||||
* Params: BMessage *msg
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_MessageReceived(BButton *Button, BMessage *msg)
|
||||
{
|
||||
Button->MessageReceived(msg);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::WindowActivated
|
||||
* Params: bool state
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_WindowActivated(BButton *Button, bool state)
|
||||
{
|
||||
Button->WindowActivated(state);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::MouseUp
|
||||
* Params: BPoint pt
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_MouseUp(BButton *Button, BPoint pt)
|
||||
{
|
||||
Button->MouseUp(pt);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::MouseMoved
|
||||
* Params: BPoint pt, uint32 code, const BMessage *msg
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_MouseMoved(BButton *Button, BPoint pt, uint32 code, const BMessage *msg)
|
||||
{
|
||||
Button->MouseMoved(pt, code, msg);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::DetachedFromWindow
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_DetachedFromWindow(BButton *Button)
|
||||
{
|
||||
Button->DetachedFromWindow();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::SetValue
|
||||
* Params: int32 value
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_SetValue(BButton *Button, int32 value)
|
||||
{
|
||||
Button->SetValue(value);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::GetPreferredSize
|
||||
* Params: float *width, float *height
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_GetPreferredSize(BButton *Button, float *width, float *height)
|
||||
{
|
||||
Button->GetPreferredSize(width, height);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::ResizeToPreferred
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_ResizeToPreferred(BButton *Button)
|
||||
{
|
||||
Button->ResizeToPreferred();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::Invoke
|
||||
* Params: BMessage *msg
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BButton_Invoke(BButton *Button, BMessage *msg)
|
||||
{
|
||||
return Button->Invoke(msg);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::FrameMoved
|
||||
* Params: BPoint new_position
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_FrameMoved(BButton *Button, BPoint new_position)
|
||||
{
|
||||
Button->FrameMoved(new_position);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::FrameResized
|
||||
* Params: float new_width, float new_height
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_FrameResized(BButton *Button, float new_width, float new_height)
|
||||
{
|
||||
Button->FrameResized(new_width, new_height);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::MakeFocus
|
||||
* Params: bool state
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_MakeFocus(BButton *Button, bool state)
|
||||
{
|
||||
Button->MakeFocus(state);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::AllAttached
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_AllAttached(BButton *Button)
|
||||
{
|
||||
Button->AllAttached();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::AllDetached
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
void
|
||||
BButton_AllDetached(BButton *Button)
|
||||
{
|
||||
Button->AllDetached();
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::ResolveSpecifier
|
||||
* Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property
|
||||
* Returns: BHandler *
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
BHandler *
|
||||
BButton_ResolveSpecifier(BButton *Button, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property)
|
||||
{
|
||||
return Button->ResolveSpecifier(msg, index, specifier, form, property);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::GetSupportedSuites
|
||||
* Params: BMessage *data
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BButton_GetSupportedSuites(BButton *Button, BMessage *data)
|
||||
{
|
||||
return Button->GetSupportedSuites(data);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::Perform
|
||||
* Params: perform_code d, void *arg
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
status_t
|
||||
BButton_Perform(BButton *Button, perform_code d, void *arg)
|
||||
{
|
||||
return Button->Perform(d, arg);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::_ReservedButton1
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
/*void
|
||||
BButton__ReservedButton1(BButton *Button)
|
||||
{
|
||||
Button->_ReservedButton1();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::_ReservedButton2
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
/*void
|
||||
BButton__ReservedButton2(BButton *Button)
|
||||
{
|
||||
Button->_ReservedButton2();
|
||||
}
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::_ReservedButton3
|
||||
* Params:
|
||||
* Returns: void
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
/*void
|
||||
BButton__ReservedButton3(BButton *Button)
|
||||
{
|
||||
Button->_ReservedButton3();
|
||||
}
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::operator=
|
||||
* Params: const BButton &
|
||||
* Returns: BButton &
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
/*BButton &
|
||||
BButton_operator=(BButton *Button, const BButton &)
|
||||
{
|
||||
return Button->operator=();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::DrawDefault
|
||||
* Params: BRect bounds, bool enabled
|
||||
* Returns: BRect
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
/*BRect
|
||||
BButton_DrawDefault(BButton *Button, BRect bounds, bool enabled)
|
||||
{
|
||||
return Button->DrawDefault(bounds, enabled);
|
||||
}
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
* Method: BButton::Execute
|
||||
* Params:
|
||||
* Returns: status_t
|
||||
* Effects:
|
||||
***********************************************************************/
|
||||
/*status_t
|
||||
BButton_Execute(BButton *Button)
|
||||
{
|
||||
return Button->Execute();
|
||||
}
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _BUTTON_CPP_ */
|
||||
532
bepascal/bepascal/be/interface/Control.cpp
Normal file
532
bepascal/bepascal/be/interface/Control.cpp
Normal file
@@ -0,0 +1,532 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#ifndef _CONTROL_CPP_
|
||||
#define _CONTROL_CPP_
|
||||
|
||||
#include "Control.h"
|
||||
#include "Rect.h"
|
||||
#include "View.h"
|
||||
#include "Message.h"
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#include "view.h"
|
||||
#include "control.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
BControl_SetEnabled_hook Control_SetEnabled_hook;
|
||||
BControl_SetValue_hook Control_SetValue_hook;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
BPControl::BPControl(TPasObject PasObject, BRect frame,
|
||||
const char *name,
|
||||
const char *label,
|
||||
BMessage *message,
|
||||
uint32 resizeMask,
|
||||
uint32 flags)
|
||||
:
|
||||
BControl(frame, name, label, message,
|
||||
resizeMask, flags),
|
||||
BPView(PasObject, frame, name, resizeMask, flags),
|
||||
BPHandler(PasObject, name),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BPControl::BPControl(TPasObject PasObject, BMessage *message):
|
||||
BControl(message),
|
||||
BPView(PasObject, message),
|
||||
BPHandler(PasObject, message),
|
||||
BPasObject(PasObject)
|
||||
{
|
||||
}
|
||||
|
||||
void BPControl::SetEnabled(bool enabled)
|
||||
{
|
||||
Control_SetEnabled_hook(GetPasObject(), enabled);
|
||||
}
|
||||
|
||||
void BPControl::SetValue(int32 value)
|
||||
{
|
||||
Control_SetValue_hook(GetPasObject(), value);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Method: BControl::BControl()
|
||||
* Descr:
|
||||
*/
|
||||
TCPlusObject BControl_Create(TPasObject PasObject, BRect frame,
|
||||
const char *name,
|
||||
const char *label,
|
||||
BMessage *message,
|
||||
uint32 resizeMask,
|
||||
uint32 flags)
|
||||
{
|
||||
return new BPControl(PasObject, frame,
|
||||
name,
|
||||
label,
|
||||
message,
|
||||
resizeMask,
|
||||
flags);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::~BControl()
|
||||
* Descr:
|
||||
*/
|
||||
|
||||
void BControl_Free(BControl *Control)
|
||||
{
|
||||
delete Control;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::BControl()
|
||||
* Descr:
|
||||
*/
|
||||
/*TCPlusObject BControl_Create(TPasObject PasObject, BMessage *data)
|
||||
{
|
||||
return new BPControl(PasObject, data);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::Instantiate()
|
||||
* Descr:
|
||||
*/
|
||||
BArchivable *
|
||||
BControl_Instantiate(BControl *Control, BMessage *data)
|
||||
{
|
||||
return Control->Instantiate(data);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::Archive()
|
||||
* Descr:
|
||||
*/
|
||||
status_t
|
||||
BControl_Archive(BControl *Control, BMessage *data,
|
||||
bool deep)
|
||||
{
|
||||
return Control->Archive(data,
|
||||
deep);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::WindowActivated()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_WindowActivated(BControl *Control, bool state)
|
||||
{
|
||||
Control->WindowActivated(state);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::AttachedToWindow()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_AttachedToWindow(BControl *Control)
|
||||
{
|
||||
Control->AttachedToWindow();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::MessageReceived()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_MessageReceived(BControl *Control, BMessage *msg)
|
||||
{
|
||||
Control->MessageReceived(msg);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::MakeFocus()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_MakeFocus(BControl *Control, bool state)
|
||||
{
|
||||
Control->MakeFocus(state);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::KeyDown()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_KeyDown(BControl *Control, const char *bytes,
|
||||
int32 numBytes)
|
||||
{
|
||||
Control->KeyDown(bytes,
|
||||
numBytes);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::MouseDown()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_MouseDown(BControl *Control, BPoint pt)
|
||||
{
|
||||
Control->MouseDown(pt);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::MouseUp()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_MouseUp(BControl *Control, BPoint pt)
|
||||
{
|
||||
Control->MouseUp(pt);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::MouseMoved()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_MouseMoved(BControl *Control, BPoint pt,
|
||||
uint32 code,
|
||||
const BMessage *msg)
|
||||
{
|
||||
Control->MouseMoved(pt,
|
||||
code,
|
||||
msg);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::DetachedFromWindow()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_DetachedFromWindow(BControl *Control)
|
||||
{
|
||||
Control->DetachedFromWindow();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::SetLabel()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_SetLabel(BControl *Control, const char *text)
|
||||
{
|
||||
Control->SetLabel(text);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::Label()
|
||||
* Descr:
|
||||
*/
|
||||
const char *
|
||||
BControl_Label(BControl *Control)
|
||||
{
|
||||
return Control->Label();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::SetValue()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_SetValue(BControl *Control, int32 value)
|
||||
{
|
||||
Control->SetValue(value);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::Value()
|
||||
* Descr:
|
||||
*/
|
||||
int32
|
||||
BControl_Value(BControl *Control)
|
||||
{
|
||||
return Control->Value();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::SetEnabled()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_SetEnabled(BControl *Control, bool on)
|
||||
{
|
||||
Control->SetEnabled(on);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::IsEnabled()
|
||||
* Descr:
|
||||
*/
|
||||
bool
|
||||
BControl_IsEnabled(BControl *Control)
|
||||
{
|
||||
return Control->IsEnabled();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::GetPreferredSize()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_GetPreferredSize(BControl *Control, float *width,
|
||||
float *height)
|
||||
{
|
||||
Control->GetPreferredSize(width,
|
||||
height);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::ResizeToPreferred()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_ResizeToPreferred(BControl *Control)
|
||||
{
|
||||
Control->ResizeToPreferred();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::Invoke()
|
||||
* Descr:
|
||||
*/
|
||||
status_t
|
||||
BControl_Invoke(BControl *Control, BMessage *msg)
|
||||
{
|
||||
return Control->Invoke(msg);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::ResolveSpecifier()
|
||||
* Descr:
|
||||
*/
|
||||
BHandler *
|
||||
BControl_ResolveSpecifier(BControl *Control, BMessage *msg,
|
||||
int32 index,
|
||||
BMessage *specifier,
|
||||
int32 form,
|
||||
const char *property)
|
||||
{
|
||||
return Control->ResolveSpecifier(msg,
|
||||
index,
|
||||
specifier,
|
||||
form,
|
||||
property);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::GetSupportedSuites()
|
||||
* Descr:
|
||||
*/
|
||||
status_t
|
||||
BControl_GetSupportedSuites(BControl *Control, BMessage *data)
|
||||
{
|
||||
return Control->GetSupportedSuites(data);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::AllAttached()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_AllAttached(BControl *Control)
|
||||
{
|
||||
Control->AllAttached();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::AllDetached()
|
||||
* Descr:
|
||||
*/
|
||||
void
|
||||
BControl_AllDetached(BControl *Control)
|
||||
{
|
||||
Control->AllDetached();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::Perform()
|
||||
* Descr:
|
||||
*/
|
||||
status_t
|
||||
BControl_Perform(BControl *Control, perform_code d,
|
||||
void *arg)
|
||||
{
|
||||
return Control->Perform(d,
|
||||
arg);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::IsFocusChanging()
|
||||
* Descr:
|
||||
*/
|
||||
/*bool
|
||||
BControl_IsFocusChanging(BControl *Control)
|
||||
{
|
||||
return Control->IsFocusChanging();
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::IsTracking()
|
||||
* Descr:
|
||||
*/
|
||||
/*bool
|
||||
BControl_IsTracking(BControl *Control)
|
||||
{
|
||||
return Control->IsTracking();
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::SetTracking()
|
||||
* Descr:
|
||||
*/
|
||||
/*void
|
||||
BControl_SetTracking(BControl *Control, bool state)
|
||||
{
|
||||
Control->SetTracking(state);
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::SetValueNoUpdate()
|
||||
* Descr:
|
||||
*/
|
||||
/*void
|
||||
BControl_SetValueNoUpdate(BControl *Control, int32 value)
|
||||
{
|
||||
Control->SetValueNoUpdate(value);
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::_ReservedControl1()
|
||||
* Descr:
|
||||
*/
|
||||
/*void
|
||||
BControl__ReservedControl1(BControl *Control)
|
||||
{
|
||||
Control->_ReservedControl1();
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::_ReservedControl2()
|
||||
* Descr:
|
||||
*/
|
||||
/*void
|
||||
BControl__ReservedControl2(BControl *Control)
|
||||
{
|
||||
Control->_ReservedControl2();
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::_ReservedControl3()
|
||||
* Descr:
|
||||
*/
|
||||
/*void
|
||||
BControl__ReservedControl3(BControl *Control)
|
||||
{
|
||||
Control->_ReservedControl3();
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::_ReservedControl4()
|
||||
* Descr:
|
||||
*/
|
||||
/*void
|
||||
BControl__ReservedControl4(BControl *Control)
|
||||
{
|
||||
Control->_ReservedControl4();
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::operator=()
|
||||
* Descr:
|
||||
*/
|
||||
/*BControl &
|
||||
BControl_operator=(BControl *Control, const BControl &)
|
||||
{
|
||||
return Control->operator=();
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* Method: BControl::InitData()
|
||||
* Descr:
|
||||
*/
|
||||
/*void
|
||||
BControl_InitData(BControl *Control, BMessage *data)
|
||||
{
|
||||
Control->InitData(data);
|
||||
}*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _CONTROL_CPP_ */
|
||||
@@ -128,6 +128,7 @@ void BPView::DetachedFromWindow(void)
|
||||
|
||||
void BPView::Draw(BRect updateRect)
|
||||
{
|
||||
BView::Draw(updateRect);
|
||||
View_Draw_hook(GetPasObject(), &updateRect);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ void BWindow_Free(TCPlusObject Window)
|
||||
void BWindow_Show(TCPlusObject Window)
|
||||
{
|
||||
reinterpret_cast<BWindow*>(Window)->Show();
|
||||
reinterpret_cast<BWindow*>(Window)->UpdateIfNeeded();
|
||||
}
|
||||
|
||||
void BWindow_Hide(TCPlusObject Window)
|
||||
|
||||
332
bepascal/bepascal/be/interface/button.pp
Normal file
332
bepascal/bepascal/be/interface/button.pp
Normal file
@@ -0,0 +1,332 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
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
|
||||
}
|
||||
unit button;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, Control, Message, Archivable, SupportDefs, Rect, Handler;
|
||||
|
||||
type
|
||||
TButton = class(TControl)
|
||||
private
|
||||
public
|
||||
destructor Destroy; override;
|
||||
constructor Create(frame : TRect; name, aLabel : PChar; message : TMessage; resizingMode, flags : Cardinal); virtual;
|
||||
constructor Create(data : TMessage); override;
|
||||
function Instantiate(data : TMessage) : TArchivable;
|
||||
function Archive(data : TMessage; deep : boolean) : TStatus_t;
|
||||
procedure Draw(updateRect : TRect); override;
|
||||
procedure MouseDown(where : TPoint); override;
|
||||
procedure AttachedToWindow; override;
|
||||
procedure KeyDown(bytes : PChar; numBytes : integer); override;
|
||||
// Hook functions
|
||||
procedure MakeDefault(state : boolean); virtual;
|
||||
procedure SetLabel(text : PChar);
|
||||
function IsDefault : boolean;
|
||||
procedure MessageReceived(msg : TMessage); override;
|
||||
procedure WindowActivated(state : boolean); override;
|
||||
procedure MouseUp(pt : TPoint); override;
|
||||
procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); override;
|
||||
procedure DetachedFromWindow; override;
|
||||
procedure SetValue(aValue : integer);
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure ResizeToPreferred; override;
|
||||
function Invoke(msg : TMessage) : TStatus_t;
|
||||
procedure FrameMoved(new_position : TPoint); override;
|
||||
procedure FrameResized(new_width : double; new_height : double); override;
|
||||
procedure MakeFocus(state : boolean); override;
|
||||
procedure AllAttached; override;
|
||||
procedure AllDetached; override;
|
||||
function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler;
|
||||
function GetSupportedSuites(data : TMessage) : TStatus_t;
|
||||
function Perform(d : TPerform_code; arg : Pointer) : TStatus_t;
|
||||
// procedure _ReservedButton1;
|
||||
// procedure _ReservedButton2;
|
||||
// procedure _ReservedButton3;
|
||||
// function operator=( : TButton) : TButton;
|
||||
// function DrawDefault(bounds : TRect; enabled : boolean) : TRect;
|
||||
// function Execute : TStatus_t;
|
||||
// procedure float fCachedWidth;
|
||||
// procedure bool fDrawAsDefault;
|
||||
// procedure uint32 _reserved[3];
|
||||
// procedure MakeDefault(flag : boolean); virtual;
|
||||
end;
|
||||
|
||||
procedure BButton_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_Free';
|
||||
function BButton_Create(AObject : TBeObject; frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BButton_Create';
|
||||
function BButton_Create(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BButton_Create';
|
||||
function BButton_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : TArchivable; cdecl; external BePascalLibName name 'BButton_Instantiate';
|
||||
function BButton_Archive(AObject : TCPlusObject; data : TCplusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BButton_Archive';
|
||||
procedure BButton_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BButton_Draw';
|
||||
procedure BButton_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BButton_MouseDown';
|
||||
procedure BButton_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_AttachedToWindow';
|
||||
procedure BButton_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BButton_KeyDown';
|
||||
procedure BButton_MakeDefault(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BButton_MakeDefault';
|
||||
procedure BButton_SetLabel(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BButton_SetLabel';
|
||||
function BButton_IsDefault(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BButton_IsDefault';
|
||||
procedure BButton_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BButton_MessageReceived';
|
||||
procedure BButton_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BButton_WindowActivated';
|
||||
procedure BButton_MouseUp(AObject : TCPlusObject; pt : TCplusObject); cdecl; external BePascalLibName name 'BButton_MouseUp';
|
||||
procedure BButton_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TMessage); cdecl; external BePascalLibName name 'BButton_MouseMoved';
|
||||
procedure BButton_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_DetachedFromWindow';
|
||||
procedure BButton_SetValue(AObject : TCPlusObject; aValue : integer); cdecl; external BePascalLibName name 'BButton_SetValue';
|
||||
procedure BButton_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BButton_GetPreferredSize';
|
||||
procedure BButton_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_ResizeToPreferred';
|
||||
function BButton_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BButton_Invoke';
|
||||
procedure BButton_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BButton_FrameMoved';
|
||||
procedure BButton_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BButton_FrameResized';
|
||||
procedure BButton_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BButton_MakeFocus';
|
||||
procedure BButton_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_AllAttached';
|
||||
procedure BButton_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_AllDetached';
|
||||
function BButton_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : THandler; cdecl; external BePascalLibName name 'BButton_ResolveSpecifier';
|
||||
function BButton_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BButton_GetSupportedSuites';
|
||||
function BButton_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BButton_Perform';
|
||||
//procedure BButton__ReservedButton1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton__ReservedButton1';
|
||||
//procedure BButton__ReservedButton2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton__ReservedButton2';
|
||||
//procedure BButton__ReservedButton3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton__ReservedButton3';
|
||||
//function BButton_operator=(AObject : TCPlusObject; : TButton) : TButton; cdecl; external BePascalLibName name 'BButton_operator=';
|
||||
//function BButton_DrawDefault(AObject : TCPlusObject; bounds : TCPlusObject; enabled : boolean) : TRect; cdecl; external BePascalLibName name 'BButton_DrawDefault';
|
||||
//function BButton_Execute(AObject : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BButton_Execute';
|
||||
//procedure BButton_float fCachedWidth(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_float fCachedWidth';
|
||||
//procedure BButton_bool fDrawAsDefault(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_bool fDrawAsDefault';
|
||||
//procedure BButton_uint32 _reserved[3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BButton_uint32 _reserved[3]';
|
||||
|
||||
//var
|
||||
// procedure BButton_MakeDefault_hook(Button : TButton; flag : boolean); cdecl; external BePascalLibName name 'BButton_MakeDefault';
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
Button_MakeDefault_hook : Pointer; cvar; external;
|
||||
|
||||
destructor TButton.Destroy;
|
||||
begin
|
||||
BButton_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
constructor TButton.Create(frame : TRect; name, aLabel : PChar; message : TMessage; resizingMode, flags : Cardinal);
|
||||
begin
|
||||
CreatePas;
|
||||
WriteLn('Creation bouton');
|
||||
CPlusObject := BButton_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags);
|
||||
end;
|
||||
|
||||
constructor TButton.Create(data : TMessage);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BButton_Create(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function TButton.Instantiate(data : TMessage) : TArchivable;
|
||||
begin
|
||||
Result := BButton_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function TButton.Archive(data : TMessage; deep : boolean) : TStatus_t;
|
||||
begin
|
||||
Result := BButton_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
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);
|
||||
begin
|
||||
BButton_SetLabel(CPlusObject, text);
|
||||
end;
|
||||
|
||||
function TButton.IsDefault : boolean;
|
||||
begin
|
||||
Result := BButton_IsDefault(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.MessageReceived(msg : TMessage);
|
||||
begin
|
||||
WriteLn('Bonjour, ici le bouton !');
|
||||
// BButton_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.WindowActivated(state : boolean);
|
||||
begin
|
||||
BButton_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure TButton.MouseUp(pt : TPoint);
|
||||
begin
|
||||
BButton_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);
|
||||
begin
|
||||
BButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure TButton.DetachedFromWindow;
|
||||
begin
|
||||
BButton_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.SetValue(aValue : integer);
|
||||
begin
|
||||
BButton_SetValue(CPlusObject, aValue);
|
||||
end;
|
||||
|
||||
procedure TButton.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BButton_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure TButton.ResizeToPreferred;
|
||||
begin
|
||||
BButton_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
function TButton.Invoke(msg : TMessage) : TStatus_t;
|
||||
begin
|
||||
Result := BButton_Invoke(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.FrameMoved(new_position : TPoint);
|
||||
begin
|
||||
BButton_FrameMoved(CPlusObject, new_position.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.FrameResized(new_width : double; new_height : double);
|
||||
begin
|
||||
BButton_FrameResized(CPlusObject, new_width, new_height);
|
||||
end;
|
||||
|
||||
procedure TButton.MakeFocus(state : boolean);
|
||||
begin
|
||||
BButton_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure TButton.AllAttached;
|
||||
begin
|
||||
BButton_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton.AllDetached;
|
||||
begin
|
||||
BButton_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
function TButton.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler;
|
||||
begin
|
||||
Result := BButton_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
function TButton.GetSupportedSuites(data : TMessage) : TStatus_t;
|
||||
begin
|
||||
Result := BButton_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function TButton.Perform(d : TPerform_code; arg : Pointer) : TStatus_t;
|
||||
begin
|
||||
Result := BButton_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
{procedure TButton._ReservedButton1;
|
||||
begin
|
||||
BButton__ReservedButton1(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton._ReservedButton2;
|
||||
begin
|
||||
BButton__ReservedButton2(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TButton._ReservedButton3;
|
||||
begin
|
||||
BButton__ReservedButton3(CPlusObject);
|
||||
end;}
|
||||
|
||||
{function TButton.operator=( : TButton) : TButton;
|
||||
begin
|
||||
Result := BButton_operator=(CPlusObject, );
|
||||
end;
|
||||
}
|
||||
|
||||
{function TButton.DrawDefault(bounds : TRect; enabled : boolean) : TRect;
|
||||
begin
|
||||
Result := BButton_DrawDefault(CPlusObject, bounds.CPlusObject, enabled);
|
||||
end;
|
||||
|
||||
function TButton.Execute : TStatus_t;
|
||||
begin
|
||||
Result := BButton_Execute(CPlusObject);
|
||||
end;}
|
||||
|
||||
{procedure TButton.float fCachedWidth;
|
||||
begin
|
||||
BButton_float fCachedWidth(CPlusObject);
|
||||
end;
|
||||
}
|
||||
|
||||
{procedure TButton.bool fDrawAsDefault;
|
||||
begin
|
||||
BButton_bool fDrawAsDefault(CPlusObject);
|
||||
end;
|
||||
}
|
||||
|
||||
{procedure TButton.uint32 _reserved[3];
|
||||
begin
|
||||
BButton_uint32 _reserved[3](CPlusObject);
|
||||
end;
|
||||
}
|
||||
|
||||
{procedure TButton.MakeDefault(flag : boolean);
|
||||
begin
|
||||
end;
|
||||
}
|
||||
|
||||
procedure Button_MakeDefault_hook_func(Button : TButton; flag : boolean); cdecl;
|
||||
begin
|
||||
if Button <> nil then
|
||||
Button.MakeDefault(flag);
|
||||
end;
|
||||
|
||||
initialization
|
||||
Button_MakeDefault_hook := @Button_MakeDefault_hook_func;
|
||||
|
||||
end.
|
||||
46
bepascal/bepascal/be/interface/control.h
Normal file
46
bepascal/bepascal/be/interface/control.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#ifndef _CONTROL_H_
|
||||
#define _CONTROL_H_
|
||||
|
||||
#include <beobj.h>
|
||||
|
||||
#include "view.h"
|
||||
|
||||
typedef void (*BControl_SetEnabled_hook) (TPasObject PasObject, bool enabled);
|
||||
typedef void (*BControl_SetValue_hook) (TPasObject PasObject, int32 value);
|
||||
|
||||
class BPControl : public BControl, virtual public BPView
|
||||
{
|
||||
public:
|
||||
// <BView_Constructor>
|
||||
BPControl(TPasObject PasObject,
|
||||
BRect frame,
|
||||
const char *name,
|
||||
const char *label,
|
||||
BMessage *message,
|
||||
uint32 resizeMask,
|
||||
uint32 flags);
|
||||
BPControl(TPasObject PasObject, BMessage *message);
|
||||
virtual void SetEnabled(bool enabled);
|
||||
virtual void SetValue(int32 value);
|
||||
private:
|
||||
};
|
||||
|
||||
#endif /* _CONTROL_H_ */
|
||||
368
bepascal/bepascal/be/interface/control.pp
Normal file
368
bepascal/bepascal/be/interface/control.pp
Normal file
@@ -0,0 +1,368 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
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
|
||||
}
|
||||
unit control;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, View, Message, Archivable, Rect, Handler, SupportDefs, Invoker;
|
||||
|
||||
type
|
||||
TControl = class(TView)
|
||||
private
|
||||
protected
|
||||
FInvoker : TInvoker;
|
||||
function GetInvoker : TInvoker;
|
||||
public
|
||||
constructor Create(frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal); virtual;
|
||||
destructor Destroy; override;
|
||||
constructor Create(data : TMessage); virtual;
|
||||
function Instantiate(data : TMessage) : TArchivable;
|
||||
function Archive(data : TMessage; deep : boolean) : TStatus_t;
|
||||
procedure WindowActivated(state : boolean); override;
|
||||
procedure AttachedToWindow; override;
|
||||
procedure MessageReceived(msg : TMessage); override;
|
||||
procedure MakeFocus(state : boolean); virtual;
|
||||
procedure KeyDown(bytes : PChar; numBytes : integer); override;
|
||||
procedure MouseDown(pt : TPoint); override;
|
||||
procedure MouseUp(pt : TPoint); override;
|
||||
procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); override;
|
||||
procedure DetachedFromWindow; override;
|
||||
procedure SetLabel(text : PChar);
|
||||
function Labl : PChar;
|
||||
procedure SetValue(aValue : integer);
|
||||
function Value : integer;
|
||||
procedure SetEnabled(aOn : boolean);
|
||||
function IsEnabled : boolean;
|
||||
procedure GetPreferredSize(width : double; height : double);
|
||||
procedure ResizeToPreferred; override;
|
||||
function Invoke(msg : TMessage) : TStatus_t;
|
||||
function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti{;-)} : PChar) : THandler;
|
||||
function GetSupportedSuites(data : TMessage) : TStatus_t;
|
||||
procedure AllAttached; override;
|
||||
procedure AllDetached; override;
|
||||
function Perform(d : TPerform_code; arg : Pointer) : TStatus_t;
|
||||
// function IsFocusChanging : boolean;
|
||||
// function IsTracking : boolean;
|
||||
// procedure SetTracking(state : boolean);
|
||||
// procedure SetValueNoUpdate(aValue : integer);
|
||||
// procedure _ReservedControl1;
|
||||
// procedure _ReservedControl2;
|
||||
// procedure _ReservedControl3;
|
||||
// procedure _ReservedControl4;
|
||||
// function operator=( : TControl) : TControl;
|
||||
// procedure InitData(data : TMessage);
|
||||
// procedure char *fLabel;
|
||||
// procedure int32 fValue;
|
||||
// procedure bool fEnabled;
|
||||
// procedure bool fFocusChanging;
|
||||
// procedure bool fTracking;
|
||||
// procedure bool fWantsNav;
|
||||
// procedure uint32 _reserved[4];
|
||||
property Invoker : TInvoker read GetInvoker;
|
||||
end;
|
||||
|
||||
//function BControl_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BControl_Create';
|
||||
function BControl_Create(AObject : TBeObject; frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BControl_Create';
|
||||
procedure BControl_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_Free';
|
||||
function BControl_Create(AObject : TBeObject; data : TCplusObject) : TCplusObject; cdecl; external BePascalLibName name 'BControl_Create';
|
||||
function BControl_Instantiate(AObject : TCPlusObject; data : TCplusObject) : TArchivable; cdecl; external BePascalLibName name 'BControl_Instantiate';
|
||||
function BControl_Archive(AObject : TCPlusObject; data : TCplusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BControl_Archive';
|
||||
procedure BControl_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BControl_WindowActivated';
|
||||
procedure BControl_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_AttachedToWindow';
|
||||
procedure BControl_MessageReceived(AObject : TCPlusObject; msg : TCplusObject); cdecl; external BePascalLibName name 'BControl_MessageReceived';
|
||||
procedure BControl_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BControl_MakeFocus';
|
||||
procedure BControl_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BControl_KeyDown';
|
||||
procedure BControl_MouseDown(AObject : TCPlusObject; pt : TCplusObject); cdecl; external BePascalLibName name 'BControl_MouseDown';
|
||||
procedure BControl_MouseUp(AObject : TCPlusObject; pt : TCplusObject); cdecl; external BePascalLibName name 'BControl_MouseUp';
|
||||
procedure BControl_MouseMoved(AObject : TCPlusObject; pt : TCplusObject; code : Cardinal; msg : TCplusObject); cdecl; external BePascalLibName name 'BControl_MouseMoved';
|
||||
procedure BControl_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_DetachedFromWindow';
|
||||
procedure BControl_SetLabel(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BControl_SetLabel';
|
||||
function BControl_Labl(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BControl_Label';
|
||||
procedure BControl_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BControl_SetValue';
|
||||
function BControl_Value(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BControl_Value';
|
||||
procedure BControl_SetEnabled(AObject : TCPlusObject; aOn : boolean); cdecl; external BePascalLibName name 'BControl_SetEnabled';
|
||||
function BControl_IsEnabled(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BControl_IsEnabled';
|
||||
procedure BControl_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BControl_GetPreferredSize';
|
||||
procedure BControl_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_ResizeToPreferred';
|
||||
function BControl_Invoke(AObject : TCPlusObject; msg : TCplusObject) : TStatus_t; cdecl; external BePascalLibName name 'BControl_Invoke';
|
||||
function BControl_ResolveSpecifier(AObject : TCPlusObject; msg : TCplusObject; index : integer; specifier : TCplusObject; form : integer; properti : PChar) : THandler; cdecl; external BePascalLibName name 'BControl_ResolveSpecifier';
|
||||
function BControl_GetSupportedSuites(AObject : TCPlusObject; data : TCplusObject) : TStatus_t; cdecl; external BePascalLibName name 'BControl_GetSupportedSuites';
|
||||
procedure BControl_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_AllAttached';
|
||||
procedure BControl_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_AllDetached';
|
||||
function BControl_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BControl_Perform';
|
||||
//function BControl_IsFocusChanging(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BControl_IsFocusChanging';
|
||||
//function BControl_IsTracking(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BControl_IsTracking';
|
||||
//procedure BControl_SetTracking(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BControl_SetTracking';
|
||||
//procedure BControl_SetValueNoUpdate(AObject : TCPlusObject; aValue : integer); cdecl; external BePascalLibName name 'BControl_SetValueNoUpdate';
|
||||
//procedure BControl__ReservedControl1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl__ReservedControl1';
|
||||
//procedure BControl__ReservedControl2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl__ReservedControl2';
|
||||
//procedure BControl__ReservedControl3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl__ReservedControl3';
|
||||
//procedure BControl__ReservedControl4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl__ReservedControl4';
|
||||
//function BControl_operator=(AObject : TCPlusObject; : TControl) : TControl; cdecl; external BePascalLibName name 'BControl_operator=';
|
||||
procedure BControl_InitData(AObject : TCPlusObject; data : TCplusObject); cdecl; external BePascalLibName name 'BControl_InitData';
|
||||
//procedure BControl_char *fLabel(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_char *fLabel';
|
||||
//procedure BControl_int32 fValue(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_int32 fValue';
|
||||
//procedure BControl_bool fEnabled(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_bool fEnabled';
|
||||
//procedure BControl_bool fFocusChanging(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_bool fFocusChanging';
|
||||
//procedure BControl_bool fTracking(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_bool fTracking';
|
||||
//procedure BControl_bool fWantsNav(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_bool fWantsNav';
|
||||
//procedure BControl_uint32 _reserved[4](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BControl_uint32 _reserved[4]';
|
||||
|
||||
implementation
|
||||
|
||||
constructor TControl.Create(frame : TCPlusObject; name, aLabel : PChar; message : TCPlusObject; resizingMode, flags : Cardinal);
|
||||
begin
|
||||
CPlusObject := BControl_Create(Self, frame, name, aLabel, message, resizingMode, flags);
|
||||
end;
|
||||
|
||||
destructor TControl.Destroy;
|
||||
begin
|
||||
if FInvoker <> nil then
|
||||
FInvoker.UnWrap;
|
||||
BControl_Free(CPlusObject);
|
||||
end;
|
||||
|
||||
constructor TControl.Create(data : TMessage);
|
||||
begin
|
||||
CPlusObject := BControl_Create(Self, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function TControl.Instantiate(data : TMessage) : TArchivable;
|
||||
begin
|
||||
Result := BControl_Instantiate(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
function TControl.Archive(data : TMessage; deep : boolean) : TStatus_t;
|
||||
begin
|
||||
Result := BControl_Archive(CPlusObject, data.CPlusObject, deep);
|
||||
end;
|
||||
|
||||
procedure TControl.WindowActivated(state : boolean);
|
||||
begin
|
||||
BControl_WindowActivated(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure TControl.AttachedToWindow;
|
||||
begin
|
||||
BControl_AttachedToWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.MessageReceived(msg : TMessage);
|
||||
begin
|
||||
BControl_MessageReceived(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.MakeFocus(state : boolean);
|
||||
begin
|
||||
BControl_MakeFocus(CPlusObject, state);
|
||||
end;
|
||||
|
||||
procedure TControl.KeyDown(bytes : PChar; numBytes : integer);
|
||||
begin
|
||||
BControl_KeyDown(CPlusObject, bytes, numBytes);
|
||||
end;
|
||||
|
||||
procedure TControl.MouseDown(pt : TPoint);
|
||||
begin
|
||||
BControl_MouseDown(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.MouseUp(pt : TPoint);
|
||||
begin
|
||||
BControl_MouseUp(CPlusObject, pt.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);
|
||||
begin
|
||||
BControl_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
|
||||
end;
|
||||
|
||||
procedure TControl.DetachedFromWindow;
|
||||
begin
|
||||
BControl_DetachedFromWindow(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.SetLabel(text : PChar);
|
||||
begin
|
||||
BControl_SetLabel(CPlusObject, text);
|
||||
end;
|
||||
|
||||
function TControl.Labl : PChar;
|
||||
begin
|
||||
Result := BControl_Labl(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.SetValue(aValue : integer);
|
||||
begin
|
||||
BControl_SetValue(CPlusObject, aValue);
|
||||
end;
|
||||
|
||||
function TControl.Value : integer;
|
||||
begin
|
||||
Result := BControl_Value(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.SetEnabled(aOn : boolean);
|
||||
begin
|
||||
BControl_SetEnabled(CPlusObject, aOn);
|
||||
end;
|
||||
|
||||
function TControl.IsEnabled : boolean;
|
||||
begin
|
||||
Result := BControl_IsEnabled(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.GetPreferredSize(width : double; height : double);
|
||||
begin
|
||||
BControl_GetPreferredSize(CPlusObject, width, height);
|
||||
end;
|
||||
|
||||
procedure TControl.ResizeToPreferred;
|
||||
begin
|
||||
BControl_ResizeToPreferred(CPlusObject);
|
||||
end;
|
||||
|
||||
function TControl.Invoke(msg : TMessage) : TStatus_t;
|
||||
begin
|
||||
Result := BControl_Invoke(CPlusObject, msg.CPlusObject);
|
||||
end;
|
||||
|
||||
function TControl.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler;
|
||||
begin
|
||||
Result := BControl_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
|
||||
end;
|
||||
|
||||
function TControl.GetSupportedSuites(data : TMessage) : TStatus_t;
|
||||
begin
|
||||
Result := BControl_GetSupportedSuites(CPlusObject, data.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.AllAttached;
|
||||
begin
|
||||
BControl_AllAttached(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure TControl.AllDetached;
|
||||
begin
|
||||
BControl_AllDetached(CPlusObject);
|
||||
end;
|
||||
|
||||
function TControl.Perform(d : TPerform_code; arg : Pointer) : TStatus_t;
|
||||
begin
|
||||
Result := BControl_Perform(CPlusObject, d, arg);
|
||||
end;
|
||||
|
||||
//function TControl.IsFocusChanging : boolean;
|
||||
//begin
|
||||
// Result := BControl_IsFocusChanging(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//function TControl.IsTracking : boolean;
|
||||
//begin
|
||||
// Result := BControl_IsTracking(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl.SetTracking(state : boolean);
|
||||
//begin
|
||||
// BControl_SetTracking(CPlusObject, state);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl.SetValueNoUpdate(aValue : integer);
|
||||
//begin
|
||||
// BControl_SetValueNoUpdate(CPlusObject, aValue);
|
||||
//end;
|
||||
|
||||
//procedure TControl._ReservedControl1;
|
||||
//begin
|
||||
// BControl__ReservedControl1(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl._ReservedControl2;
|
||||
//begin
|
||||
// BControl__ReservedControl2(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl._ReservedControl3;
|
||||
//begin
|
||||
// BControl__ReservedControl3(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl._ReservedControl4;
|
||||
//begin
|
||||
// BControl__ReservedControl4(CPlusObject);
|
||||
//end;
|
||||
|
||||
//function TControl.operator=( : TControl) : TControl;
|
||||
//begin
|
||||
// Result := BControl_operator=(CPlusObject, );
|
||||
//end;
|
||||
|
||||
//procedure TControl.InitData(data : TMessage);
|
||||
//begin
|
||||
// BControl_InitData(CPlusObject, data.CPlusObject);
|
||||
//end;
|
||||
|
||||
//procedure TControl.char *fLabel;
|
||||
//begin
|
||||
// BControl_char *fLabel(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl.int32 fValue;
|
||||
//begin
|
||||
// BControl_int32 fValue(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl.bool fEnabled;
|
||||
//begin
|
||||
// BControl_bool fEnabled(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl.bool fFocusChanging;
|
||||
//begin
|
||||
// BControl_bool fFocusChanging(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl.bool fTracking;
|
||||
//begin
|
||||
// BControl_bool fTracking(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl.bool fWantsNav;
|
||||
//begin
|
||||
// BControl_bool fWantsNav(CPlusObject);
|
||||
//end;
|
||||
//
|
||||
//procedure TControl.uint32 _reserved[4];
|
||||
//begin
|
||||
// BControl_uint32 _reserved[4](CPlusObject);
|
||||
//end;
|
||||
|
||||
function TControl.GetInvoker : TInvoker;
|
||||
begin
|
||||
if FInvoker = nil then
|
||||
begin
|
||||
WriteLn('Before GetInvoker');
|
||||
Result := TInvoker.Wrap(CPlusObject);
|
||||
WriteLn('After GetInvoker');
|
||||
end;
|
||||
Result := FInvoker;
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -180,6 +180,8 @@ end;
|
||||
|
||||
procedure TView.Draw(updateRect : TRect);
|
||||
begin
|
||||
WriteLn('Drawing view');
|
||||
|
||||
end;
|
||||
|
||||
procedure TView.DrawAfterChildren(updateRect : TRect);
|
||||
@@ -243,7 +245,10 @@ end;
|
||||
|
||||
procedure TView.AddChild(aView, before : TView);
|
||||
begin
|
||||
BView_AddChild(Self.CPlusObject, aView.CPlusObject, before.CPlusObject);
|
||||
if before <> nil then
|
||||
BView_AddChild(Self.CPlusObject, aView.CPlusObject, before.CPlusObject)
|
||||
else
|
||||
BView_AddChild(Self.CPlusObject, aView.CPlusObject, nil);
|
||||
end;
|
||||
|
||||
function TView.RemoveChild(aView : TView) : boolean;
|
||||
|
||||
Reference in New Issue
Block a user