(CodeLib-Manager)
Registriert seit: 10. Jun 2002
4.648 Beiträge
Delphi XE Professional
|
12. Jun 2002, 12:06
Hi,
Warum ist dein Code so seltsam formatiert?
Code:
procedure EnterTab(Sender: TObject; var Key: Word; Shift: TShiftState;
ClassAus: array of TClass; ObjectAus: array of TObject;
bESC_Close: Boolean = True);
var
Mgs: TMsg;
//_____________________________KAPSELUNG
function ClassObjectAusschliessen: Boolean;
var
Index: Integer;
begin
Result := False;
with Sender as TForm do
begin
for Index := Low(ClassAus) to High(ClassAus) do
if ActiveControl is ClassAus[Index] then // Diese Classe ausschliessen
begin
Result := True;
Exit;
end;
for Index := Low(ObjectAus) to High(ObjectAus) do
if ActiveControl = ObjectAus[Index] then // Dieses Object ausschliessen
begin
Result := True;
Break;
end;
end;
end;
//_______________________________HAUPTPROGRAMM
begin
if Sender is TForm then
with Sender as TForm do
begin
if (Shift = [ssShift]) then
case Key of
VK_RETURN: if not ClassObjectAusschliessen then
begin
// Shift + ENTER-Taste erkannt
Key := 0;
Perform(WM_NextDlgCtl, 1, 0);
PeekMessage(Mgs, 0, WM_CHAR, WM_CHAR, PM_REMOVE);
// Beep-Ton ausschalten
end;
VK_TAB: if ClassObjectAusschliessen then
begin // ENTER-Taste erkannt
Key := 0;
Perform(WM_NextDlgCtl, 1, 0);
PeekMessage(Mgs, 0, WM_CHAR, WM_CHAR, PM_REMOVE);
// Beep-Ton ausschalten
end;
end // für CASE Key OF
else
case Key of
VK_RETURN: if not ClassObjectAusschliessen then
begin
// ENTER-Taste erkannt
Key := 0;
Perform(WM_NextDlgCtl, 0, 0);
PeekMessage(Mgs, 0,
WM_CHAR, WM_CHAR, PM_REMOVE); // Beep-Ton ausschalten
end;
VK_TAB: if ClassObjectAusschliessen then
begin
// ENTER-Taste erkannt
Key := 0;
Perform(WM_NextDlgCtl, 0, 0);
PeekMessage(Mgs, 0,
WM_CHAR, WM_CHAR, PM_REMOVE); // Beep-Ton ausschalten
end;
VK_ESCAPE: if bESC_Close then
begin
Key := 0;
Close;
PeekMessage(Mgs, 0,
WM_CHAR, WM_CHAR, PM_REMOVE); // Beep-Ton ausschalten
end;
end // für CASE Key OF
end; // für WITH Sender As TForm DO
end;
Thomas
|
|
Zitat
|