Текущий архив: 2003.02.06;
Скачать: CL | DM;
ВнизИконка компонента на ToolBar - Delphi. Найти похожие ветки
← →
Brain (2003-01-29 10:43) [0]Лиди такой трабл я сам сделал компонет для Delphi, как мне добавить к компоненту иконку, каторая будет видна в Delphi-ToolBar.
Заранее благодарин ...
← →
Anatoly Podgoretsky (2003-01-29 10:50) [1]Можно с помощью Image Editor
← →
REA (2003-01-29 10:52) [2]Вставить в компонент ресурс с картинкой (24x24 кажется) с именем компонента. Подробнее написано в документации.
← →
Brain (2003-01-29 11:10) [3]Если каму не впадлу,то поподоробней опишите.
← →
REA (2003-01-29 11:16) [4]Every component needs a bitmap to represent it on the Component palette. If you don"t specify your own bitmap, the IDE uses a default bitmap. Because the palette bitmaps are needed only at design time, you don"t compile them into the component"s compilation unit. Instead, you supply them in a Windows resource file with the same name as the unit., but with the .dcr (dynamic component resource) extension. You can create this resource file using the Image editor.
When you create a new component, you can define your own bitmaps for custom components.
To create a new bitmap:
1 Choose Tools|Image Editor.
2 In the Image Editor dialog box, choose File|New|Component Resource File (.dcr).
3 In the untitled1.dcr dialog box, right-click Contents. Choose New|Bitmap.
4 In the Bitmaps Properties dialog box, change both the Width and Height to 24 pixels. Make sure VGA (16 colors) is checked. Click OK.
5 Bitmap and Bitmap1 appear below Contents. Select Bitmap1, right-click, and choose Rename. Give the bitmap the same name as the class name for your new component, including the T, using all uppercase letters. For example, if your new class name is going to be TMyNewButton, name the bitmap TMYNEWBUTTON.
Note
You must name all uppercase letters, no matter how you spell the class name in the New Component dialog box.
6 Double-click TMYNEWBUTTON to display a dialog box with an empty bitmap.
7 Use the color palette at the bottom of the Image Editor to design your icon.
8 Choose File|Save As and give the resource file (.dcr or .res) the same base name as the unit you want the component class declared in. For example, name the resource file MyNewButton.dcr.
9 Choose Component|New Component. Follow the instructions for creating a new component using the Component wizard. Make sure that the component source, MyNewButton.pas, is in the same directory as MyNewButton.dcr.
The Component wizard, for a class named TMyNewButton, names the component source, or unit, MyNewButton.pas with a default placement in the LIB directory. Click the Browse button to find the new location for the generated component unit.
Note
If you are using a .res file for the bitmap rather than a .dcr file, then add a reference to the component source to bind the resource. For example, if your .res file is named MyNewButton.res, after ensuring that the .pas and .res are in the same directory, add the following to MyNewButton.pas below the type section:
{*R *.res}
10 Choose Component|Install Component to install your component into a new or existing package. Click OK.
Your new package is built and then installed. The bitmap representing your new component appears on the Component palette page you designated in the Component wizard.
← →
D-NICKNAME (2003-01-29 11:19) [5]Открой чужой dcr-файл в ImageEditor"е - сразу поймёшь...
← →
Brain (2003-01-29 15:18) [6]Ok.
Страницы: 1 вся ветка
Текущий архив: 2003.02.06;
Скачать: CL | DM;
Память: 0.45 MB
Время: 0.009 c