Autor Beitrag
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: Mo 08.12.08 14:06 
user profile iconSAiBOT hat folgendes geschrieben Zum zitierten Posting springen:
user profile iconDeddyH hat folgendes geschrieben Zum zitierten Posting springen:
Das sollte sich mit minimalem Aufwand ja nachrüsten lassen.


Ja nur dann nicht mehr mit Boolean, also ist das ganze Bsp. futsch :P .
InitMax, InitMin, wenn beides nicht, normal ;-).
SAiBOT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: Mo 08.12.08 14:33 
user profile iconjaenicke hat folgendes geschrieben Zum zitierten Posting springen:
user profile iconSAiBOT hat folgendes geschrieben Zum zitierten Posting springen:
user profile iconDeddyH hat folgendes geschrieben Zum zitierten Posting springen:
Das sollte sich mit minimalem Aufwand ja nachrüsten lassen.


Ja nur dann nicht mehr mit Boolean, also ist das ganze Bsp. futsch :P .
InitMax, InitMin, wenn beides nicht, normal ;-).


Das sind dann zwei Booleans also zwei Ini-Einträge. Ich würde einen Eintrg bevorzugen (Integer) aber das ist Geschmackssache :wink:

_________________
Debuggers don't remove bugs, they only show them in slow-motion.
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 08.12.08 15:07 
Ist bei 2 Boolean auch dann blöde, wenn beide true sind ;)
Chemiker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 194
Erhaltene Danke: 14

XP, Vista 32 Bit, Vista 64 Bit, Win 7 64 Bit, Win 10, Win 11
BDS 2006, RAD Studio 2009+C++, Delphi 13, VS 2010 Prof.
BeitragVerfasst: Do 11.12.08 02:35 
Hallo,

ich muss mich Entschuldigen, dass ich ohne genaue Prüfung ein Beispiel aus der Delphi – Hilfe übernommen habe.

Korrigierte Ini-Funktionen:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
function IniSchreiben (aForm: TForm; strIniDateiName: TFileName): boolean;
var
  Ini: TIniFile;
begin
  Result:= True;
  ini:= TIniFile.Create(strIniDateiName);
  try
    Ini.WriteInteger(aForm.Caption, 'Top', aForm.Top);
    Ini.WriteInteger(aForm.Caption, 'Left', aForm.Left);
    Ini.WriteString(aForm.Caption, 'Caption', aForm.Caption );
    Ini.WriteBool(aForm.Caption, 'InitMax', aForm.WindowState = wsMaximized );
  finally
    Ini.Free;
  end;
end;

function IniLesenAnlegen (aForm: TForm; strIniDateiName: TFileName): boolean;
var
  Ini: TIniFile;
begin
  Result:= TRUE;
  ini:= TIniFile.Create(strIniDateiName);
  try
    aForm.Top := Ini.ReadInteger( aForm.Caption, 'Top'100 );
    aForm.Left := Ini.ReadInteger( aForm.Caption, 'Left'100 );
    aForm.Caption := Ini.ReadString( aForm.Caption, 'Caption', aForm.Caption );
    if Ini.ReadBool( aForm.Caption, 'InitMax', false ) then
    begin
      aForm.WindowState := wsMaximized;
    end else
    begin
      aForm.WindowState := wsNormal;
    end;
  finally
    Ini.Free;
  end;
end;

wsMinimized wird aber nicht behandelt, weis nicht welchen Sinn das machen soll.

Bis bald Chemiker
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 11.12.08 09:11 
Das muss Dir doch nicht Leid tun, dass der Hersteller blödsinnigen Code in seine Beispiele schreibt.