Re: ActiveX in F50 has too large font

From: Patrick Wolf <patrick.wolf_at_telekabel.at>
Date: Thu, 06 Aug 1998 18:55:03 GMT
Message-ID: <35c9fb32.1012345_at_news.telekabel.at>


Hi,

appended an article about that from Oracle Metalink:

Article-ID:         <Note:46165.1>
Circulation:        PUBLISHED (EXTERNAL)
Folder:             client.Dev2000.Forms.V5
Platform:           GENERIC  Generic issue
Topic:              Hints: OLE and ActiveX in Forms 5
Subject:            Setting the Font Of ActiveX Controls
Modified-Date:      10-MAR-1998 16:40:17
Document-Type:      BULLETIN
Impact:             MEDIUM

Setting the Font Property of ActiveX (OCX) Controls in Forms 5.0


Introduction:



Although Developer/2000 Forms version 5.0 can generate a lot of the code that
you will need in order to manipulate ActiveX controls, using the OLE Importer facility, it does not do everything. One Problem are is in the setting of control Properties, which are themselves
complex objects, rather than simple data values. The most common of these properties is the Font Property. The code in this note allows you to set the Properies of the Font object for
any control.

Usage:



The ActiveX_Set_Font procedure must be passed the Object handle to the Font
Object. You can obtain this by calling the Font function that will have been generated for your ActiveX Control by the OLE
Importer.
For Example: The oracle Spreadtable control has a Package Function called
OracleSpreadTable_DMmtx.font() generated for it. This function returns the handle that we need.

To Set the Font of a Spreadtable control in :Block1.Grid to Underlined

"Wingdings" font:
  declare

     hFontObj oleobj;
  begin
    /* get the handle to the font structure using

       code generated by OLE importer */     hFontObj :=

OracleSpreadTable_DMmtx.font(:item('BLOCK1.GRID').interface);

    /* Call the ActiveX_Set_Font proc to do it.. */

ActiveX_set_font(hFontObj,FontName=>'Wingdings',FontUnderline=>TRUE); end;

Code:


PROCEDURE ActiveX_Set_Font ( FontObject           IN OLEOBJ,
                             FontName             IN VARCHAR2 default
NULL,
                             FontSize             IN NUMBER   default
NULL,
                             FontBold             IN BOOLEAN  default
NULL,
                             FontItalic           IN BOOLEAN  default
NULL,
                             FontStrikeThrough    IN BOOLEAN  default
NULL,
                             FontUnderline        IN BOOLEAN  default
NULL,
                             FontWeight           IN NUMBER   default
NULL) IS
/*--------------------------------------------------------------------*\
  • Example:
  • To change the Font on an embedded OCX
  • Called "Grid" in Block1 you first would have
  • to get the handle to the font object using either
  • the Generated FONT function for that control that
  • was built by the OLE Importer, or you could get
  • the Handle Directly using
  • hFont := OLE2.GET_OBJ_PROPERTY(:item('BLOCK1.GRID').interface,'font');
  • Then to set the font properties:
  • ActiveX_Set_Font(hFont,FontName=>'Wingdings',FontSize=>20);
  • Notes:
  • The Weight Property will usually be a value of 400 for Normal
  • and 700 for Bold (consult your VB documentation) \*--------------------------------------------------------------------*/

 Function TO_VB_BOOLEAN (bORA in BOOLEAN) Return PLS_INTEGER is   iRC PLS_INTEGER;
 begin
  if bORA then

        iRC := -1;
  else

        iRC := 0;
  end if;
  return iRC;
 end;

BEGIN
 if FontName is not NULL then

        ole2.set_property(FontObject,'name',FontName);  end if;

 if FontSize is not NULL then

        ole2.set_property(FontObject,'size',FontSize);  end if;

 if FontWeight is not NULL then

        ole2.set_property(FontObject,'weight',FontWeight);  end if;

 if FontBold is not NULL then

        ole2.set_property(FontObject,'bold',TO_VB_BOOLEAN(FontBold));  end if;

 if FontItalic is not NULL then

ole2.set_property(FontObject,'italic',TO_VB_BOOLEAN(FontItalic));  end if;

 if FontStrikeThrough is not NULL then

        ole2.set_property(FontObject,'strikethrough',
                              TO_VB_BOOLEAN(FontStrikeThrough));
 end if;

 if FontUnderline is not NULL then

ole2.set_property(FontObject,'underline',TO_VB_BOOLEAN(FontUnderline));  end if;
END; On Thu, 6 Aug 1998 20:03:51 +0300, "Janek Metsallik" <jan_at_abs.ee> wrote:

>Hi,
>
>Oracle Power Objects treeview control works well on forms 5.0.
>The hint in this group about the ocx was very helpful
>
>Only thing is the font it uses by default. The font is too large.
>Can anyone explain the way to change the control's font?
>Ole importer creates these two methods for the task,
>but I couldn't find any samples of handling the mysterious OleVar
>variables in PL/SQL.
>
>FUNCTION Font(interface OleObj) RETURN OleVar;
>PROCEDURE Font(interface OleObj, newvalue OleVar);
>
>Thank You!
>
>Janek Metsallik
>
>
>

-------------------------------

Patrick Wolf
Working for Scientific Games, Vienna

E-Mails: patrick.wolf_at_telekabel.at (home)

         wolf_at_scigames.at (work) Received on Thu Aug 06 1998 - 20:55:03 CEST

Original text of this message