interfaces: remove AssignSelf method

git-svn-id: trunk@29827 -
This commit is contained in:
paul 2011-03-14 02:17:55 +00:00
parent 3dc56449d7
commit f0bce37226
7 changed files with 19 additions and 36 deletions

View File

@ -170,7 +170,6 @@ type
procedure DestroyConnectedWidget(Widget: PGtkWidget;
CheckIfDestroying: boolean);virtual;
function RecreateWnd(Sender: TObject): Integer; virtual;
procedure AssignSelf(Child, Data: Pointer);virtual;
// clipboard
procedure SetClipboardWidget(TargetWidget: PGtkWidget);virtual;

View File

@ -4318,15 +4318,6 @@ begin
end;
end;
{------------------------------------------------------------------------------
TGtkWidgetSet AssignSelf
*Note: Assigns a pointer to self on a widget
------------------------------------------------------------------------------}
procedure TGtkWidgetSet.AssignSelf(Child,Data : Pointer);
begin
gtk_Object_Set_Data(Pgtkobject(Child),'Self',Data);
end;
{------------------------------------------------------------------------------
TGtkWidgetSet ShowHide
*Note: Show or hide a widget

View File

@ -161,7 +161,6 @@ type
procedure DestroyConnectedWidget(Widget: PGtkWidget;
CheckIfDestroying: boolean);virtual;
function RecreateWnd(Sender: TObject): Integer; virtual;
procedure AssignSelf(Child, Data: Pointer);virtual;
// clipboard
procedure SetClipboardWidget(TargetWidget: PGtkWidget);virtual;

View File

@ -4711,15 +4711,6 @@ begin
end;
end;
{------------------------------------------------------------------------------
TGtkWidgetSet AssignSelf
*Note: Assigns a pointer to self on a widget
------------------------------------------------------------------------------}
procedure TGtk2WidgetSet.AssignSelf(Child,Data : Pointer);
begin
gtk_Object_Set_Data(Pgtkobject(Child),'Self',Data);
end;
{------------------------------------------------------------------------------
TGtkWidgetSet ShowHide
*Note: Show or hide a widget

View File

@ -82,6 +82,9 @@ implementation
{$I gtk2defines.inc}
var
MenuWidget: PGtkWidget = nil;
function Gtk2MenuItemButtonPress(widget: PGtkWidget; event: PGdkEventButton;
user_data: gpointer): gboolean; cdecl;
var
@ -619,6 +622,8 @@ end;
procedure gtkWSPopupMenuDeactivate(widget: PGtkWidget; data: gPointer); cdecl;
begin
if widget = MenuWidget then
MenuWidget := nil;
if data <> nil then
g_idle_add(@gtkWSPopupDelayedClose, Pointer(PWidgetInfo(data)^.LCLObject));
end;
@ -651,7 +656,6 @@ class procedure TGtk2WSPopupMenu.Popup(const APopupMenu: TPopupMenu; const X,
var
APoint: TPoint;
AProc: Pointer;
MenuWidget: PGtkWidget;
WidgetInfo: PWidgetInfo;
begin
ReleaseMouseCapture;
@ -665,9 +669,22 @@ begin
WidgetInfo^.DataOwner := False;
// MenuWidget can be either GtkMenu or GtkMenuItem submenu
if GTK_IS_MENU_ITEM(MenuWidget) then
MenuWidget := gtk_menu_item_get_submenu(PGtkMenuItem(MenuWidget));
MenuWidget := gtk_menu_item_get_submenu(PGtkMenuItem(MenuWidget));
gtk_menu_popup(PGtkMenu(MenuWidget), nil, nil, TGtkMenuPositionFunc(AProc),
WidgetInfo, 0, gtk_get_current_event_time());
repeat
try
WidgetSet.AppProcessMessages; // process all events
except
if Application.CaptureExceptions then
Application.HandleException(APopupMenu)
else
raise;
end;
if Application.Terminated or not Assigned(MenuWidget) then
break;
Application.Idle(true);
until False;
end;
end.

View File

@ -137,7 +137,6 @@ type
FOnAsyncSocketMsg: TSocketEvent;
FDotsPatternBitmap: HBitmap;
procedure AssignSelf(Window: HWnd; Data: Pointer);
function GetDotsPatternBitmap: HBitmap;
{ event handler helper functions }

View File

@ -734,19 +734,6 @@ begin
FAppHandle := AValue;
end;
{------------------------------------------------------------------------------
Method: TWin32WidgetSet.AssignSelf
Params: Window - The window to assign
Data - The data to assign to the window
Returns: Nothing
Assigns data to a window
------------------------------------------------------------------------------}
procedure TWin32WidgetSet.AssignSelf(Window: HWnd; Data: Pointer);
begin
//DebugLn('Trace:[TWin32WidgetSet.AssignSelf] Trying to code it. It''s probably wrong.');
end;
function TWin32WidgetSet.GetDotsPatternBitmap: HBitmap;
const
Dots: array[0..3] of Word = ($55, $AA, $55, $AA);