HTML Kit site requirements.

HTML editor / Support Document
HomeHTML-Kit downloadsAdd-ins that update and extend HTML-Kit's capabilitiesSoftware and authoring support channelsRegister -- download add-ons and support HTML-KitOnline tools for HTML-Kit users
 

Support Document

 Home > Support > Support Documents > Plugins > How to: Draw icons at ru...
 
 
How to: Draw icons at runtime
The information in this document applies to:
 Summary

This document lists the commands that can be used to draw plugins related icons at runtime.
 
 Details

Starting with HTML-Kit Build 292 alpha 20020203, icons used by plugins can be drawn at runtime. Set the "MODE_ICON" parameter to 4 and pass the command string used to draw the icon to the icon parameter ("ICON_SMALL" for example) as shown below:

--- cut here ---
function hkp_Register(pDataIn, pDataOut)
{
    // create an icon with red, green and blue bars
  var sIcon1 = "BC=#ff0000;FR=0,0,4,15;BC=#008000;FR=5,0,9,15;BC=#0000ff;FR=10,0,14,15;";

  hkp_DataSetGlobalSuffix("_1");

  hkp_DataAdd(pDataOut, "NAME", "demoDrawIcon");

  hkp_DataAddInt(pDataOut, "MODE_ICON", 4);
  hkp_DataAdd(pDataOut, "ICON_SMALL", sIcon1);

  hkp_DataSetGlobalSuffix("");
}

function hkp_Main(pDataIn, pDataOut)
{
  // run the plugin
}
--- cut here ---

Following is a list of commands that can be used to draw on the icon (# = number, $ = hex color code, @ = string):

PC=<$ pen color>;

Set the current pen color.
 
PW=<# pen width>;

Change the current width of the pen. Default = 1 pixel.
 
PS=<# pen style>;

Change the style of the current pen. 0 = clear, 1 = solid. Default = 1/solid.
 
BC=<$ brush color>;

Change the current brush color.
 
BS=<# brush style>;

Change the current style of the brush. 0 = clear, 1 = solid. Default = 0/clear.
 
P=<# X coordinate>,<# Y coordinate>;

Draw a pixel at X, Y coordinate using the current pen color.
 
MT=<# X coordinate>,<# Y coordinate>;

Move the cursor to the specified X,Y coordinate.
 
LT=<# X coordinate>,<# Y coordinate>;

Draw a line from the current cursor position to the specifed X,Y coordinate.
 
R=<# top left X>,<# top left Y>,<# bottom right X>,<# bottom right Y>;

Draw a rectangle.
 
RR=<# top left X>,<# top left Y>,<# bottom right X>,<# bottom right Y>,<# round X>,<# round Y>;

Draw a round rectangle.
 
EL=<# top left X>,<# top left Y>,<# bottom right X>,<# bottom right Y>;

Draw an ellipse or a circle inside the specified rectangle.
 
FR=<# top left X>,<# top left Y>,<# bottom right X>,<# bottom right Y>;

Draw a rectangle using the current pen and fill the inside using the current brush.
 
FF=<# X coordinate>,<# Y coordinate>,<$ fill limit color>,<# fill mode>;

Flood fill using the current brush starting at the specified X,Y coordinate against the fill limit color. Fill Mode: 1 = surface, 0 = border.
 
FN=<# length of the name>,<@ font name>;

Change the current font.
 
FS=<# font size>;

Set the current font size.
 
TO=<# X coordinate>,<# Y coordinate>,<# length of the text>,<@ text>;

Draw the specified text at the X,Y coordinate using the current font.
 
TC=<$ transparent color>;

Set the color used by transparent pixels.
 
DM=<# bits per pixel>;

Set the number of bits per pixel.
 
 
 References
How to: Write context menu plugins
 
 
 
Document ID: H000140
Reviewed On: 05-Feb-2002
THE INFORMATION IN THIS DOCUMENT IS PROVIDED ON AN AS-IS BASIS WITHOUT WARRANTY OF ANY KIND. PROVIDER SPECIFICALLY DISCLAIMS ANY OTHER WARRANTY, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL PROVIDER BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, SPECIAL OR INCIDENTAL DAMAGES, EVEN IF PROVIDER HAS BEEN ADVISED BY "USER" OF THE POSSIBILITY OF SUCH POTENTIAL LOSS OR DAMAGE. "USER" AGREES TO HOLD PROVIDER HARMLESS FROM AND AGAINST ANY AND ALL CLAIMS, LOSSES, LIABILITIES AND EXPENSES.