File: pfc_m_oc.srm
Size: 4564
Date: Tue, 22 Jan 2008 23:30:43 +0100
$PBExportHeader$pfc_m_oc.srm
$PBExportComments$PFC Ole Control menu class
forward
global type pfc_m_oc from menu
end type
type m_object from menu within pfc_m_oc
end type
type m_edit from menu within m_object
end type
type m_open from menu within m_object
end type
type m_dash11 from menu within m_object
end type
type m_cut from menu within m_object
end type
type m_copy from menu within m_object
end type
type m_paste from menu within m_object
end type
type m_object from menu within pfc_m_oc
m_edit m_edit
m_open m_open
m_dash11 m_dash11
m_cut m_cut
m_copy m_copy
m_paste m_paste
end type
end forward

global type pfc_m_oc from menu
m_object m_object
end type
global pfc_m_oc pfc_m_oc

type variables
Protected:
olecontrol  ioc_parent
end variables

forward prototypes
public function integer of_setparent (olecontrol aoc_parent)
end prototypes

public function integer of_setparent (olecontrol aoc_parent);//////////////////////////////////////////////////////////////////////////////
//
// Function:  of_SetParent
//
// Access:  public
//
// Arguments:
// aoc_parent   parent object of the menu
//
// Returns:  integer
//  1 = success
// -1 = failure, parent reference is not valid
//
// Description:  Sets the parent object of this menu
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
/*
 * Open Source PowerBuilder Foundation Class Libraries
 *
 * Copyright (c) 2004-2005, All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted in accordance with the GNU Lesser General
 * Public License Version 2.1, February 1999
 *
 * http://www.gnu.org/copyleft/lesser.html
 *
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals and was originally based on software copyright (c) 
 * 1996-2004 Sybase, Inc. http://www.sybase.com.  For more
 * information on the Open Source PowerBuilder Foundation Class
 * Libraries see http://pfc.codexchange.sybase.com
*/
//
//////////////////////////////////////////////////////////////////////////////

integer  li_rc = 1

if IsValid (aoc_parent) then
   ioc_parent = aoc_parent
else
   li_rc = -1
end if

return li_rc
end function

on pfc_m_oc.create
pfc_m_oc=this
this.m_object=create m_object
this.Item[]={this.m_object}
end on

on pfc_m_oc.destroy
destroy(this.m_object)
end on

type m_object from menu within pfc_m_oc
m_edit m_edit
m_open m_open
m_dash11 m_dash11
m_cut m_cut
m_copy m_copy
m_paste m_paste
end type

on m_object.create
this.Text="Object"
this.m_edit=create m_edit
this.m_open=create m_open
this.m_dash11=create m_dash11
this.m_cut=create m_cut
this.m_copy=create m_copy
this.m_paste=create m_paste
this.Item[]={this.m_edit, &
this.m_open, &
this.m_dash11, &
this.m_cut, &
this.m_copy, &
this.m_paste}
end on

on m_object.destroy
destroy(this.m_edit)
destroy(this.m_open)
destroy(this.m_dash11)
destroy(this.m_cut)
destroy(this.m_copy)
destroy(this.m_paste)
end on

type m_edit from menu within m_object
end type

on m_edit.create
this.Text="&Edit"
this.Microhelp="Activates the object"
end on

event clicked;ioc_parent.dynamic event pfc_editobject()
end event

type m_open from menu within m_object
end type

on m_open.create
this.Text="&Open"
this.Microhelp="Activates the object"
end on

event clicked;ioc_parent.dynamic event pfc_openobject()
end event

type m_dash11 from menu within m_object
end type

on m_dash11.create
this.Text="-"
end on

type m_cut from menu within m_object
end type

on m_cut.create
this.Text="C&ut"
this.Microhelp="Moves the selection to the Clipboard"
this.ShiftToRight=true
end on

event clicked;ioc_parent.dynamic event pfc_cut()
end event

type m_copy from menu within m_object
end type

on m_copy.create
this.Text="&Copy"
this.Microhelp="Copies the selection to the Clipboard"
this.ShiftToRight=true
end on

event clicked;ioc_parent.dynamic event pfc_copy()
end event

type m_paste from menu within m_object
end type

on m_paste.create
this.Text="&Paste"
this.Microhelp="Inserts the Clipboard contents at the insertion point"
this.ShiftToRight=true
end on

event clicked;ioc_parent.dynamic event pfc_paste()
end event