Jump to content

any object creation examples?


Recommended Posts

  • 2 weeks later...

Hey,

I recently made a small plugin object trough the plug-in editor(Tools=>scripts=>vw plugin editor).

Its ment to be a heat device drawn as a rectangle and some info in it.

I've added it to my post, use it as a plug in object or look at the code of it to give you a heads up..

PROCEDURE Radiator;

VAR

bc_ht,bc_wid,bc_height,bc_vermogen,i: REAL;

bc_fontsize,keuzes,height,numberpos : INTEGER;

objname,vermogen,bc_number: STRING;

bc_textposition,bc_numberposition: CHAR;

oh,rh,wh: HANDLE;

result,hidetext,shownumber: BOOLEAN;

BEGIN

{ retrieve custom object information }

result:= GetCustomObjectInfo(objname,oh,rh,wh);

{ if object information was successfully retrieved }

IF result THEN BEGIN

{ retrieve predefined parameter values }

bc_ht := PRWIDTH;

bc_wid := PRLENGTH;

bc_height := PRHEIGHT;

bc_vermogen := PVERMOGEN;

bc_textposition := PSHOW_VERMOGEN;

bc_numberposition := PSHOW_NUMBER;

bc_fontsize := PFONTSIZE;

bc_number := PNUMBER;

vermogen:=concat(bc_vermogen,' W');

{ retrieve user-defined parameter values }

{ draw }

i:=0";

PushAttrs;

FillPat(0);

{ draw rectangle with coordinates }

Rect(0,bc_ht,bc_wid,0);

{ draw text }

TextFont(GetFontID('Monaco'));

TextSize(bc_fontsize);

TextJust(2);

hidetext :=true;

shownumber :=true;

CASE bc_textposition OF

'O': height :=bc_ht+25;

'I': height :=bc_ht;

'H': hidetext :=false;

OTHERWISE height :=bc_ht+25;

END;

IF hidetext THEN BEGIN

TextOrigin(bc_wid/2,height);

BeginText;

vermogen

EndText;

END;

CASE bc_numberposition OF

'L': BEGIN numberpos :=3;height:=-5; END;

'R': BEGIN numberpos :=1;

height:=bc_wid+5;

END;

'H': shownumber :=false;

OTHERWISE BEGIN numberpos :=3;

height:=-5; END;

END;

IF shownumber THEN BEGIN

TextJust(numberpos);

TextOrigin(height,bc_ht);

BeginText;

bc_number

EndText;

END;

PopAttrs;

END;

END;

Run(Radiator);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...