Autor Beitrag
evpator
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Mi 22.06.05 15:07 
Hello All

I develop a specialized graphical editor....

And I have an idea to make a tools palette like in Photoshop

In the Photoshop tools palette there are some buttons with a small
triangle at the right bottom corner. When we click on this triangle
than additional submenu appears with same buttons.

Does anybody know the name of such a control(toolbutton+submenu)?
Or maybe someone can advise a component for Delphi?!

Thanks.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 23.06.05 08:57 
Well one possibility would be the TToolBar.

There you can create Buttons and set the style to tbsDropDown. Then you have a button as the one for "back" in the Internet Explorer.
You don't have such a triangle as you thought of, but it's only another design with this triangle at the right.

If you want to have such a triangle at the bottom right you'll have to develop a new button. You can use TButton as ancestor. Then you have to override the WndProc and look for WM_PAINT. As reaction on this message you paint this triangle, but do not mark the message as handled.

Perhaps you could set OwnerDraw to true and paint the triangle in onCustomDraw, but I don't know whether this is available in the TButton class.

Then you can use onMouseDown for implementing an reaction. If the mouse is over this triangle when clicking you have to prevent executing the reaction for onClick. Therefore you can use a variable which is set to true in case the mouse was clicked over this triangle. In onMouseUp you have to set it back to false!

If I didn't explain this enough please ask again...

By the way: don't you speak german? If you do, you should ask in german here...
evpator Threadstarter
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Do 23.06.05 09:18 
Thanks for the response

I don't speak german. (I am from Ukraine.)
I just searched for a nice Delphi forum.
This one seems to me very intensive ....
and I hoped someone here understands english.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 23.06.05 09:26 
Well this is no problem, here are enough members who can speak english...

Oh and a better way came to my mind. You just have to override the paint procedure! There you call inherited, so the original things are all painted and then you can paint this triangle. To have an image displayed on the button you have to derive it from TSpeedButton or TBitBtn.
(Otherwise you'd have to paint the image on yourself too...)

Little example (not ready yet):
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
type
  TMyButton = class(TBitBtn)
  //(...)
    procedure Paint; override;

//(...)

//in paint you do:
procedure Paint;
begin
  inherited;
  //call the overridden original procedure
  Self.Canvas. //... paint the triangle
end;
evpator Threadstarter
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Do 23.06.05 10:39 
The same advise I was given on the russian Delphi forum. :)

The matter is that some time ago I seen and played with a component
which I need now. And I can't to remember the name .... And can't
to find again :))

If I will not find ... than I will do like you advised.
dasICHbin
Hält's aus hier
Beiträge: 1

Win ME, Win 2000, Win XP

BeitragVerfasst: Do 24.11.05 16:49 
Mal ne ganz doofe Frage...
Wo zum Geier finde ich diese TToolBar in dieser ellenlangen Komponentenliste von Delphi 2005? Ich würd das gerne mal ausprobieren, find's aber nicht und hab wirklich keine Lust alles durchzusuchen Oo
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 24.11.05 17:43 
Diese Standard-Komponenten findest du immer unter Standard, Win32, System, Zusätzlich oder so. Das sind nicht viele Kategorien. Ich glaube die TToolbar liegt unter Zusätzlich oder Win32...