HA$PBExportHeader$pfc_u_oc.sru $PBExportComments$PFC OleControl class forward global type pfc_u_oc from olecontrol end type end forward global type pfc_u_oc from olecontrol int Width=347 int Height=248 int TabOrder=1 BorderStyle BorderStyle=StyleLowered! boolean FocusRectangle=false omActivation Activation=ActivateOnDoubleClick! omContentsAllowed ContentsAllowed=ContainsAny! omDisplayType DisplayType=DisplayAsContent! event type integer pfc_cut ( ) event type integer pfc_copy ( ) event type integer pfc_paste ( ) event type integer pfc_clear ( ) event type integer pfc_pastespecial ( ) event rbuttonup pbm_rbuttonup event contextmenu pbm_contextmenu event pfc_prermbmenu ( ref m_oc am_oc ) event type integer pfc_updatelinks ( ) event type integer pfc_editobject ( ) event type integer pfc_openobject ( ) event type integer pfc_insertobject ( ) end type global pfc_u_oc pfc_u_oc type variables Protected: boolean ib_rmbmenu = true end variables forward prototypes public function integer of_getparentwindow (ref window aw_parent) protected function integer of_messagebox (string as_id, string as_title, string as_text, icon ae_icon, button ae_button, integer ai_default) end prototypes event pfc_cut;////////////////////////////////////////////////////////////////////////////// // // Event: pfc_cut // // (Arguments: None) // // (Returns: integer // Return value from the PowerScript Cut function) // // Description: Cut the text to the clipboard. // ////////////////////////////////////////////////////////////////////////////// // // 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 */ // ////////////////////////////////////////////////////////////////////////////// Return this.Cut() end event event pfc_copy;////////////////////////////////////////////////////////////////////////////// // // Event: pfc_copy // // (Arguments: None) // // (Returns: integer // Return value from the PowerScript Copy function) // // Description: Copy the text to the clipboard. // ////////////////////////////////////////////////////////////////////////////// // // 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 */ // ////////////////////////////////////////////////////////////////////////////// Return this.Copy() end event event pfc_paste;////////////////////////////////////////////////////////////////////////////// // // Event: pfc_paste // // (Arguments: None) // // (Returns: integer // Return value from the PowerScript Paste function) // // Description: Paste the text from the clipboard. // ////////////////////////////////////////////////////////////////////////////// // // 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 */ // ////////////////////////////////////////////////////////////////////////////// Return this.Paste() end event event pfc_clear;////////////////////////////////////////////////////////////////////////////// // // Event: pfc_clear // // (Arguments: None) // // (Returns: integer // Return value from the PowerScript Clear function) // // Description: Clear Text (no clipboard) functionality // ////////////////////////////////////////////////////////////////////////////// // // 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 */ // ////////////////////////////////////////////////////////////////////////////// Return this.Clear() end event event pfc_pastespecial;////////////////////////////////////////////////////////////////////////////// // // Event: pfc_pastespecial // // (Arguments: None) // // (Returns: integer // Return value from the PowerScript PasteSpecial function) // // Description: Displays a standard OLE 2.0 dialog allowing the user to // choose whether to embed or link the OLE object on the // clipboard when pasting it in the specified control. // ////////////////////////////////////////////////////////////////////////////// // // 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 */ // ////////////////////////////////////////////////////////////////////////////// Return this.PasteSpecial() end event event rbuttonup;////////////////////////////////////////////////////////////////////////////// // Event: rbuttonup // Description: ////////////////////////////////////////////////////////////////////////////// // Rev. History Version // 5.0 Initial version // 8.0 Moved existing code for PopUp menu to new contextmenu event ////////////////////////////////////////////////////////////////////////////// /* * 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 */ ////////////////////////////////////////////////////////////////////////////// Return 1 end event event contextmenu;////////////////////////////////////////////////////////////////////////////// // Event: contextmenu // Description: Popup menu ////////////////////////////////////////////////////////////////////////////// // Rev. History Version // 8.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 */ ////////////////////////////////////////////////////////////////////////////// boolean lb_frame string ls_classdisplayname m_oc lm_oc window lw_parent window lw_frame window lw_sheet window lw_childparent // Determine if RMB popup menu should occur if not ib_rmbmenu or Len (this.objectdata) = 0 then return 1 end if // Determine parent window for PointerX, PointerY offset this.of_GetParentWindow (lw_parent) if IsValid (lw_parent) then // Get the MDI frame window if available lw_frame = lw_parent do while IsValid (lw_frame) if lw_frame.windowtype = mdi! or lw_frame.windowtype = mdihelp! then lb_frame = true exit else lw_frame = lw_frame.ParentWindow() end if loop if lb_frame then // If MDI frame window is available, use it as the reference point for the // popup menu for sheets (windows opened with OpenSheet function) or child windows if lw_parent.windowtype = child! then lw_parent = lw_frame else lw_sheet = lw_frame.GetFirstSheet() if IsValid (lw_sheet) then do // Use frame reference for popup menu if the parentwindow is a sheet if lw_sheet = lw_parent then lw_parent = lw_frame exit end if lw_sheet = lw_frame.GetNextSheet (lw_sheet) loop until IsNull(lw_sheet) Or not IsValid (lw_sheet) end if end if else // SDI application. All windows except for child windows will use the parent // window of the control as the reference point for the popmenu if lw_parent.windowtype = child! then lw_childparent = lw_parent.ParentWindow() if IsValid (lw_childparent) then lw_parent = lw_childparent end if end if end if else return 1 end if // Create popup menu lm_oc = create m_oc lm_oc.of_SetParent (this) // Customize appearance of menu items ls_classdisplayname = this.ClassShortName if Len (ls_classdisplayname) = 0 then ls_classdisplayname = this.ClassLongName end if if Len (ls_classdisplayname) > 0 then lm_oc.m_object.m_edit.text = lm_oc.m_object.m_edit.text + " " + ls_classdisplayname lm_oc.m_object.m_open.text = lm_oc.m_object.m_open.text + " " + ls_classdisplayname end if // Allow menu items to be changed this.event pfc_prermbmenu (lm_oc) lm_oc.m_object.PopMenu (lw_parent.PointerX() + 5, lw_parent.PointerY() + 10) destroy lm_oc return 1 end event event pfc_updatelinks;////////////////////////////////////////////////////////////////////////////// // // Event: pfc_updatelinks // // Arguments: none // // Returns: integer // // Description: Updates links // ////////////////////////////////////////////////////////////////////////////// // // 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 */ // ////////////////////////////////////////////////////////////////////////////// return this.UpdateLinksDialog() end event event pfc_editobject;////////////////////////////////////////////////////////////////////////////// // // Event: pfc_editobject // // Arguments: none // // Returns: integer // 0 = success // -1 = Control is empty // -2 = Invalid verb for object // -3 = Verb not implemented by object // -4 = No verbs supported by object // -5 = Object can$$HEX1$$1920$$ENDHEX$$t execute verb now // -9 = Other error // // Description: Activates the object inplace // ////////////////////////////////////////////////////////////////////////////// // // 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 */ // ////////////////////////////////////////////////////////////////////////////// return this.Activate (inplace!) end event event pfc_openobject;////////////////////////////////////////////////////////////////////////////// // // Event: pfc_openobject // // Arguments: none // // Returns: integer // 0 = success // -1 = Control is empty // -2 = Invalid verb for object // -3 = Verb not implemented by object // -4 = No verbs supported by object // -5 = Object can$$HEX1$$1920$$ENDHEX$$t execute verb now // -9 = Other error // // Description: Activates the object offsite // ////////////////////////////////////////////////////////////////////////////// // // 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 */ // ////////////////////////////////////////////////////////////////////////////// return this.Activate (offsite!) end event event pfc_insertobject;////////////////////////////////////////////////////////////////////////////// // // Event: pfc_insertobject // // Arguments: none // // Returns: integer // 0 = success // 1 = User canceled out of dialog // -9 = Other error // // Description: Inserts an object into the ole control // ////////////////////////////////////////////////////////////////////////////// // // 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 li_rc = this.InsertObject() if li_rc = 0 then this.Activate (inplace!) end if return li_rc end event public function integer of_getparentwindow (ref window aw_parent);////////////////////////////////////////////////////////////////////////////// // // Function: of_GetParentWindow // // Access: public // // Arguments: // aw_parent The Parent window for this object (passed by reference). // If a parent window is not found, aw_parent is NULL // // Returns: integer // 1 = success // -1 = error // // Description: Calculates the parent window of a window object // ////////////////////////////////////////////////////////////////////////////// // // 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 */ // ////////////////////////////////////////////////////////////////////////////// powerobject lpo_parent lpo_parent = this.GetParent() // Loop getting the parent of the object until it is of type window! do while IsValid (lpo_parent) if lpo_parent.TypeOf() <> window! then lpo_parent = lpo_parent.GetParent() else exit end if loop if IsNull(lpo_parent) Or not IsValid (lpo_parent) then setnull(aw_parent) return -1 end If aw_parent = lpo_parent return 1 end function protected function integer of_messagebox (string as_id, string as_title, string as_text, icon ae_icon, button ae_button, integer ai_default);////////////////////////////////////////////////////////////////////////////// // // Function: of_MessageBox // // Access: protected // // Arguments: // as_id An ID for the Message. // as_title Text for title bar // as_text Text for the actual message. // ae_icon The icon you want to display on the MessageBox. // ae_button Set of CommandButtons you want to display on the MessageBox. // ai_default The default button. // // Returns: integer // Return value of the MessageBox. // // Description: // Display a PowerScript MessageBox. // Allow PFC MessageBoxes to be manipulated prior to their actual display. // ////////////////////////////////////////////////////////////////////////////// // // Revision History // // Version // 6.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 */ // ////////////////////////////////////////////////////////////////////////////// Return MessageBox(as_title, as_text, ae_icon, ae_button, ai_default) end function event getfocus;////////////////////////////////////////////////////////////////////////////// // // Event: getfocus // // (Arguments: None) // // (Returns: None) // // Description: If appropriate, notify the parent window that this // control got focus. // ////////////////////////////////////////////////////////////////////////////// // // 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 */ // ////////////////////////////////////////////////////////////////////////////// window lw_parent //Check for microhelp requirements. If gnv_app.of_GetMicrohelp() Then //Notify the parent. of_GetParentWindow(lw_parent) If IsValid(lw_parent) Then lw_parent.Dynamic Event pfc_ControlGotFocus (this) End If End If end event
File: pfc_u_oc.sru
Size: 24879
Date: Sat, 23 Mar 2013 16:23:04 +0100
Size: 24879
Date: Sat, 23 Mar 2013 16:23:04 +0100
- olecontrol pfc_u_oc(sru)