Board index » delphi » Delphi 1: menu shortcuts

Delphi 1: menu shortcuts

Hello!,
can anyone tell me, how to translate the menu shortcuts as "Ctrl",
"Alt", etc. with Delphi 1.
I have no VCL sources.

Mit freundlichen Gr?en
Matthias Frey
--
Ingenieurbro Matthias Frey; Biberweg 4; D-72768 Reutlingen
Tel. 07121-968037; Fax. 07121-968038
eMail: Matthias.F...@neckar-alb.de
http://MatthiasFrey.ecoteam.net

 

Re:Delphi 1: menu shortcuts


I'm not sure if this is exactly what your asking but if you want to assign
a shortcut such as Alt+O to a menu item named Open1 then you can do it as
follows:

At design time:

Click on the menu item and then in the object inspector select the ShortCut
property and type Alt+O or select it from one of the shortcuts in the drop
down list.

At runtime:

procedure TForm1.FormCreate(Sender: TObject);
begin
  Open1.ShortCut := ShortCut(Word('O'), [ssAlt]);
end;

Same results from both.

Hope this helps!
--

Rodney E Geraghty
GERA-Tech
Ottawa, Canada
gera...@ibm.net

Matthias Frey <Matthias.F...@neckar-alb.de> wrote in article
<35182113.8E169...@neckar-alb.de>...

Quote
> Hello!,
> can anyone tell me, how to translate the menu shortcuts as "Ctrl",
> "Alt", etc. with Delphi 1.
> I have no VCL sources.

> Mit freundlichen Gr?en
> Matthias Frey
> --
> Ingenieurbro Matthias Frey; Biberweg 4; D-72768 Reutlingen
> Tel. 07121-968037; Fax. 07121-968038
> eMail: Matthias.F...@neckar-alb.de
> http://MatthiasFrey.ecoteam.net

Re:Delphi 1: menu shortcuts


Sorry, this helps not,
for exmaple
when I write
    Open1.ShortCut := ShortCut(Word('O'), [ssShift]);
I get "Shift+O"

but I need for example "Umsch+O" (german)
I have to translate "Shift", "Ctrl" and other tokens

Matthias Frey
--
Ingenieurbro Matthias Frey; Biberweg 4; D-72768 Reutlingen
Tel. 07121-968037; Fax. 07121-968038
eMail: Matthias.F...@neckar-alb.de
http://MatthiasFrey.ecoteam.net

Re:Delphi 1: menu shortcuts


In article <35197769.6EBAE...@neckar-alb.de>, Matthias Frey

Quote
<Matthias.F...@neckar-alb.de> writes:
>when I write
>    Open1.ShortCut := ShortCut(Word('O'), [ssShift]);
>I get "Shift+O"

>but I need for example "Umsch+O" (german)
>I have to translate "Shift", "Ctrl" and other tokens

These strings are constants held in as resources named Smkc????, ie SmkcShift,
SmkcCtrl etc.

You will find them in the Delphi1\Source\Vcl\En\Consts.RC file and German
language values in the Delphi1\Source\Vcl\Ge\Consts.rc. The Delphi1\Source\Vcl
directory contains appropriate copies of these files and the corresponding .RES
file.

What are you doing about all the other language dependent messages ?.

What you could do is to recompile Consts.dcu including the German Consts.RES
files, and replace the Consts.dcu in the \Delphi1\Source\Lib directory. You
would have to be careful to make sure you could recover the original situation
if things went pear-shaped.

You had better make sure you know what you're doing, and think carefully about
it, before doing it though <g>

Alan Lloyd
alangll...@aol.com

Re:Delphi 1: menu shortcuts


AlanGLLoyd schrieb:

Quote
> In article <35197769.6EBAE...@neckar-alb.de>, Matthias Frey
> <Matthias.F...@neckar-alb.de> writes:

> >when I write
> >    Open1.ShortCut := ShortCut(Word('O'), [ssShift]);
> >I get "Shift+O"

> >but I need for example "Umsch+O" (german)
> >I have to translate "Shift", "Ctrl" and other tokens

> These strings are constants held in as resources named Smkc????, ie SmkcShift,
> SmkcCtrl etc.

Thanks for your reply.

Quote
> You will find them in the Delphi1\Source\Vcl\En\Consts.RC file and German
> language values in the Delphi1\Source\Vcl\Ge\Consts.rc. The Delphi1\Source\Vcl
> directory contains appropriate copies of these files and the corresponding .RES
> file.

I dont have these directories. I have Delphi 1.0 and Delphi 2 Developer. When I
bought Delphi 2.0, I read, the VCL Sources are included. Delphi 1.0 is also
included. But there are only sources of Delphi 2. By checking this sources, I know
what happens, but I cant use this sources with Delphi 1. I think I need only
menus.pas to change one procedure. But I hate to buy the very old VCL package for
200DM (ca. 130$)

Quote
> What are you doing about all the other language dependent messages ?.

I have different empty dll-files for each language. Each contains a string
resource. At runtime I load the specified dll. When a Form is loaded, all items
where filled with the strings. I have control over all items. I also can change the
menu caption, but not the shortcut as "Ctrl"

Quote
> What you could do is to recompile Consts.dcu including the German Consts.RES
> files, and replace the Consts.dcu in the \Delphi1\Source\Lib directory. You
> would have to be careful to make sure you could recover the original situation
> if things went pear-shaped.
> You had better make sure you know what you're doing, and think carefully about
> it, before doing it though <g>

> Alan Lloyd
> alangll...@aol.com

Another idea?

Matthias Frey
--
Ingenieurbro Matthias Frey; Biberweg 4; D-72768 Reutlingen
Tel. 07121-968037; Fax. 07121-968038
eMail: Matthias.F...@neckar-alb.de
http://MatthiasFrey.ecoteam.net

Other Threads