Home Download Screenshots Documentation Actions Plugins Translations Developers Donate Forums/Help Contact Us |
StrokeIt
Quick LinksStrokeIt SDK - (Updated: 21 March, 2003) - A sample plugin to get you started. See the Plugins page for more plugin source code. StrokeIt SDK for Borland - The same plugin as above, but with files and instructions for building with Borland compilers. Ask questions in the Plugin Development section of forums to get expert help or just to discuss the plugins you've created..
Gory DetailsCreating StrokeIt plugins is very simple, even for novice programmers. Take some time to read over the notes below, grab the SDK, and you can have your first plugin up and running withing just a few minutes Ignoring the Default LibrariesBy default, StrokeIt plugins ignore the default C/C++ libraries, which makes the resulting dll much smaller (~30k smaller). Unfortunately, this means that support for common C string managment functions needs to be recreated, and is now available through either the Windows API, or functions I've written in StrLib.cpp.
That should be the most commonly used functions. If there's anything that's really lacking, you'll either need to code it yourself, or compile in the default libraries. Defining StringsIn an effort to make plugins as easily translateable as possible, the string
resources are stored in a textfile name Strings are declared in the file StringDefs.h, and are simply declare as shown below: To declare a string (Strings.h) STR(COMMAND_TEXT)
To define the string text, just add a line to To define a string (English.lng) This is the command text.
NOTE: The strings must be defined in
Using StringsStrings can be referenced as STR(STRING_ID), where STRING_ID is the name declared in StringDefs.h (COMMAND_TEXT, in the example above) Since the strings are defined in a language file, and we want them to override any strings you've specified in your dialog resources, you'll need to explicitly set each string used in your dialogs. The SET() command makes this process pretty painless: To set a dialog item's string SET(IDC_COMMAND, STR(COMMAND_TEXT));
IDC_COMMAND is the resource ID. Working with ParametersUnless you're writing a relatively simple plugin, you're probably going to need to let users configure your commands. Using the strlib functions, you can easily save and restore user inteface parameters. Saving ParametersThe SAVE() and RETURN_SAVE() functions will automatially include calls to BEGIN_SAVE() END_SAVE() Available functions:To save a textbox: SaveItem(IDC_EDIT_BOX);To save a check box: SaveCheck(IDC_CHECK, "checked");
"checked" is the value to save if the the box is checked. If it is not checked, the paramater will be left blank. To save a combo box: Assuming that the values in the dialog box have been added using AddCombo(), (see the Restoring Parameters section to see how to do this) you can just call SaveCombo(IDC_COMBO);
To save a radio setting:
RADIO(3); // we have 3 radio buttons
The string value passed as the second paramater to ADDRADIO is what will be saved as the paramater. To save an exact string: SaveStr("string");
To save an integer: SaveInt(123);
Restoring ParametersYou must call BEGIN_RESTORE() before calling any Restore functions, and call END_RESTORE() when you're finished. Available functions:To restore a text box: RestoreItem(IDC_EDIT_BOX);
To restore a check box: RestoreCheck(IDC_CHECK, "checked");
If the parameter matches "checked", the box will be checked. To restore a combo box:
COMBO(IDC_COMBO, STR(ONE), "one");
To restore a radio setting:
NEWRADIO(3);
To restore an exact string: RestoreStr(IDC_EDIT_BOX, "string");
To restore an integer: RestoreInt(IDC_EDIT_BOX, 123);
|