Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2003.02.06;
Скачать: [xml.tar.bz2];

Вниз

Иконка компонента на 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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.015 c
7-15952
Стил
2002-11-30 22:06
2003.02.06
Выключить звук и монитор в 2000 Win


3-15524
Andy Eremin
2003-01-21 10:22
2003.02.06
DBGrid


6-15792
dkDimon
2002-12-14 23:28
2003.02.06
Pager


14-15826
Geser
2003-01-22 03:10
2003.02.06
Убей в себе Ленина!


14-15924
Безногий Сусанин
2003-01-21 12:21
2003.02.06
Принимаю рационализаторские планы по уничтожению Пентагона...





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский