亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? rxini.pas

?? RX Library contains a large number of components, objects and routines for Borland Delphi with full
?? PAS
字號(hào):
{*******************************************************}
{                                                       }
{         Delphi VCL Extensions (RX)                    }
{                                                       }
{         Copyright (c) 1995 AO ROSNO                   }
{         Copyright (c) 1997, 1998 Master-Bank          }
{                                                       }
{*******************************************************}

unit RXIni;

interface

{$I RX.INC}

uses {$IFDEF WIN32} Windows, Registry, {$ELSE} WinTypes, WinProcs, {$ENDIF}
  Classes, IniFiles, Graphics;

type
  TReadObjectEvent = function(Sender: TObject; const Section,
    Item, Value: string): TObject of object;
  TWriteObjectEvent = procedure(Sender: TObject; const Section, Item: string;
    Obj: TObject) of object;

{ TRxIniFile }

  TRxIniFile = class(TIniFile)
  private
    FListItemName: String;
    FOnReadObject: TReadObjectEvent;
    FOnWriteObject: TWriteObjectEvent;
    function GetItemName: string;
    procedure SetItemName(const Value: string);
    function ReadListParam(const Section: string; Append: Boolean; List: TStrings): TStrings;
  protected
    procedure WriteObject(const Section, Item: string; Index: Integer; Obj: TObject); dynamic;
    function ReadObject(const Section, Item, Value: string): TObject; dynamic;
  public
    constructor Create(const FileName: string);
    destructor Destroy; override;
    procedure Flush;
{$IFNDEF WIN32}
    procedure DeleteKey(const Section, Ident: String);
{$ENDIF}
    { ini-file read and write methods }
    function ReadClearList(const Section: string; List: TStrings): TStrings;
    function ReadList(const Section: string; List: TStrings): TStrings;
    procedure WriteList(const Section: string; List: TStrings);
    function ReadColor(const Section, Ident: string; Default: TColor): TColor;
    procedure WriteColor(const Section, Ident: string; Value: TColor);
    function ReadFont(const Section, Ident: string; Font: TFont): TFont;
    procedure WriteFont(const Section, Ident: string; Font: TFont);
    function ReadRect(const Section, Ident: string; const Default: TRect): TRect;
    procedure WriteRect(const Section, Ident: string; const Value: TRect);
    function ReadPoint(const Section, Ident: string; const Default: TPoint): TPoint;
    procedure WritePoint(const Section, Ident: string; const Value: TPoint);
    { properties }
    property ListItemName: string read GetItemName write SetItemName;
    property OnReadObject: TReadObjectEvent read FOnReadObject write FOnReadObject;
    property OnWriteObject: TWriteObjectEvent read FOnWriteObject write FOnWriteObject;
  end;

function StringToFontStyles(const Styles: string): TFontStyles;
function FontStylesToString(Styles: TFontStyles): string;
function FontToString(Font: TFont): string;
procedure StringToFont(const Str: string; Font: TFont);
function RectToStr(Rect: TRect): string;
function StrToRect(const Str: string; const Def: TRect): TRect;
function PointToStr(P: TPoint): string;
function StrToPoint(const Str: string; const Def: TPoint): TPoint;

function DefProfileName: string;
function DefLocalProfileName: string;

const
  idnListItem  = 'Item';

implementation

Uses SysUtils, Forms, rxStrUtils {$IFNDEF WIN32}, Str16 {$ENDIF};

const
  idnListCount = 'Count';
  idnDefString = #255#255;
  Lefts  = ['[', '{', '('];
  Rights = [']', '}', ')'];

{ Utilities routines }

function DefLocalProfileName: string;
begin
  Result := ChangeFileExt(Application.ExeName, '.INI');
end;

function DefProfileName: string;
begin
  Result := ExtractFileName(DefLocalProfileName);
end;

function FontStylesToString(Styles: TFontStyles): string;
begin
  Result := '';
  if fsBold in Styles then Result := Result + 'B';
  if fsItalic in Styles then Result := Result + 'I';
  if fsUnderline in Styles then Result := Result + 'U';
  if fsStrikeOut in Styles then Result := Result + 'S';
end;

function StringToFontStyles(const Styles: string): TFontStyles;
begin
  Result := [];
  if Pos('B', UpperCase(Styles)) > 0 then Include(Result, fsBold);
  if Pos('I', UpperCase(Styles)) > 0 then Include(Result, fsItalic);
  if Pos('U', UpperCase(Styles)) > 0 then Include(Result, fsUnderline);
  if Pos('S', UpperCase(Styles)) > 0 then Include(Result, fsStrikeOut);
end;

function FontToString(Font: TFont): string;
begin
  with Font do
    Result := Format('%s,%d,%s,%d,%s,%d', [Name, Size,
      FontStylesToString(Style), Ord(Pitch), ColorToString(Color),
      {$IFDEF RX_D3} Charset {$ELSE} 0 {$ENDIF}]);
end;

type
  THackFont = class(TFont);

procedure StringToFont(const Str: string; Font: TFont);
const
  Delims = [',', ';'];
var
  FontChange: TNotifyEvent;
  Pos: Integer;
  I: Byte;
  S: string;
begin
  FontChange := Font.OnChange;
  Font.OnChange := nil;
  try
    Pos := 1;
    I := 0;
    while Pos <= Length(Str) do begin
      Inc(I);
      S := Trim(ExtractSubstr(Str, Pos, Delims));
      case I of
        1: Font.Name := S;
        2: Font.Size := StrToIntDef(S, Font.Size);
        3: Font.Style := StringToFontStyles(S);
        4: Font.Pitch := TFontPitch(StrToIntDef(S, Ord(Font.Pitch)));
        5: Font.Color := StringToColor(S);
{$IFDEF RX_D3}
        6: Font.Charset := TFontCharset(StrToIntDef(S, Font.Charset));
{$ENDIF}
      end;
    end;
  finally
    Font.OnChange := FontChange;
    THackFont(Font).Changed;
  end;
end;

function RectToStr(Rect: TRect): string;
begin
  with Rect do
    Result := Format('[%d,%d,%d,%d]', [Left, Top, Right, Bottom]);
end;

function StrToRect(const Str: string; const Def: TRect): TRect;
var
  S: string;
  Temp: string[10];
  I: Integer;
begin
  Result := Def;
  S := Str;
  if (S[1] in Lefts) and (S[Length(S)] in Rights) then begin
    Delete(S, 1, 1); SetLength(S, Length(S) - 1);
  end;
  I := Pos(',', S);
  if I > 0 then begin
    Temp := Trim(Copy(S, 1, I - 1));
    Result.Left := StrToIntDef(Temp, Def.Left);
    Delete(S, 1, I);
    I := Pos(',', S);
    if I > 0 then begin
      Temp := Trim(Copy(S, 1, I - 1));
      Result.Top := StrToIntDef(Temp, Def.Top);
      Delete(S, 1, I);
      I := Pos(',', S);
      if I > 0 then begin
        Temp := Trim(Copy(S, 1, I - 1));
        Result.Right := StrToIntDef(Temp, Def.Right);
        Delete(S, 1, I);
        Temp := Trim(S);
        Result.Bottom := StrToIntDef(Temp, Def.Bottom);
      end;
    end;
  end;
end;

function PointToStr(P: TPoint): string;
begin
  with P do Result := Format('[%d,%d]', [X, Y]);
end;

function StrToPoint(const Str: string; const Def: TPoint): TPoint;
var
  S: string;
  Temp: string[10];
  I: Integer;
begin
  Result := Def;
  S := Str;
  if (S[1] in Lefts) and (S[Length(Str)] in Rights) then begin
    Delete(S, 1, 1); SetLength(S, Length(S) - 1);
  end;
  I := Pos(',', S);
  if I > 0 then begin
    Temp := Trim(Copy(S, 1, I - 1));
    Result.X := StrToIntDef(Temp, Def.X);
    Delete(S, 1, I);
    Temp := Trim(S);
    Result.Y := StrToIntDef(Temp, Def.Y);
  end;
end;

{ TRxIniFile }

constructor TRxIniFile.Create(const FileName: string);
begin
  inherited Create(FileName);
  FListItemName :=idnListItem;
  FOnReadObject := nil;
  FOnWriteObject := nil;
end;

destructor TRxIniFile.Destroy;
begin
  //if (FListItemName <> nil) and (FListItemName^ <> '') then Dispose(FListItemName);
  inherited Destroy;
end;

procedure TRxIniFile.Flush;
var
{$IFDEF WIN32}
  CFileName: array[0..MAX_PATH] of WideChar;
{$ELSE}
  CFileName: array[0..127] of Char;
{$ENDIF}
begin
{$IFDEF WIN32}
  if (Win32Platform = VER_PLATFORM_WIN32_NT) then 
    WritePrivateProfileStringW(nil, nil, nil, StringToWideChar(FileName,
      CFileName, MAX_PATH))
  else
    WritePrivateProfileString(nil, nil, nil, PChar(FileName));
{$ELSE}
  WritePrivateProfileString(nil, nil, nil, StrPLCopy(CFileName,
    FileName, SizeOf(CFileName) - 1));
{$ENDIF}
end;

{$IFNDEF WIN32}
procedure TRxIniFile.DeleteKey(const Section, Ident: String);
var
  CSection: array[0..127] of Char;
  CIdent: array[0..127] of Char;
  CFileName: array[0..127] of Char;
begin
  WritePrivateProfileString(StrPLCopy(CSection, Section, SizeOf(CSection) - 1),
    StrPLCopy(CIdent, Ident, SizeOf(CIdent) - 1), nil,
    StrPLCopy(CFileName, FileName, SizeOf(CFileName) - 1));
end;
{$ENDIF}

function TRxIniFile.GetItemName: string;
begin
  Result := FListItemName;
end;

procedure TRxIniFile.SetItemName(const Value: string);
begin
  FListItemName := Value;
end;

procedure TRxIniFile.WriteObject(const Section, Item: string; Index: Integer;
  Obj: TObject);
begin
  if Assigned(FOnWriteObject) then FOnWriteObject(Self, Section, Item, Obj);
end;

function TRxIniFile.ReadObject(const Section, Item, Value: string): TObject;
begin
  Result := nil;
  if Assigned(FOnReadObject) then Result := FOnReadObject(Self, Section, Item, Value);
end;

procedure TRxIniFile.WriteList(const Section: string; List: TStrings);
var
  I: Integer;
begin
  EraseSection(Section);
  WriteInteger(Section, idnListCount, List.Count);
  for I := 0 to List.Count - 1 do begin
    WriteString(Section, ListItemName + IntToStr(I), List[I]);
    WriteObject(Section, ListItemName + IntToStr(I), I, List.Objects[I]);
  end;
end;

function TRxIniFile.ReadListParam(const Section: string; Append: Boolean;
  List: TStrings): TStrings;
var
  I, IniCount: Integer;
  AssString: string;
begin
  Result := List;
  IniCount := ReadInteger(Section, idnListCount, -1);
  if IniCount >= 0 then begin
    if not Append then List.Clear;
    for I := 0 to IniCount - 1 do begin
      AssString := ReadString(Section, ListItemName + IntToStr(I), idnDefString);
      if AssString <> idnDefString then
        List.AddObject(AssString, ReadObject(Section, ListItemName +
          IntToStr(I), AssString));
    end;
  end;
end;

function TRxIniFile.ReadClearList(const Section: string; List: TStrings): TStrings;
begin
  Result := ReadListParam(Section, False, List);
end;

function TRxIniFile.ReadList(const Section: string; List: TStrings): TStrings;
begin
  Result := ReadListParam(Section, True, List);
end;

function TRxIniFile.ReadColor(const Section, Ident: string;
  Default: TColor): TColor;
begin
  try
    Result := StringToColor(ReadString(Section, Ident,
      ColorToString(Default)));
  except
    Result := Default;
  end;
end;

procedure TRxIniFile.WriteColor(const Section, Ident: string; Value: TColor);
begin
  WriteString(Section, Ident, ColorToString(Value));
end;

function TRxIniFile.ReadRect(const Section, Ident: string; const Default: TRect): TRect;
begin
  Result := StrToRect(ReadString(Section, Ident, RectToStr(Default)), Default);
end;

procedure TRxIniFile.WriteRect(const Section, Ident: string; const Value: TRect);
begin
  WriteString(Section, Ident, RectToStr(Value));
end;

function TRxIniFile.ReadPoint(const Section, Ident: string; const Default: TPoint): TPoint;
begin
  Result := StrToPoint(ReadString(Section, Ident, PointToStr(Default)), Default);
end;

procedure TRxIniFile.WritePoint(const Section, Ident: string; const Value: TPoint);
begin
  WriteString(Section, Ident, PointToStr(Value));
end;

function TRxIniFile.ReadFont(const Section, Ident: string; Font: TFont): TFont;
begin
  Result := Font;
  try
    StringToFont(ReadString(Section, Ident, FontToString(Font)), Result);
  except
    { do nothing, ignore any exceptions }
  end;
end;

procedure TRxIniFile.WriteFont(const Section, Ident: string; Font: TFont);
begin
  WriteString(Section, Ident, FontToString(Font));
end;

end.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲四区在线观看| 激情五月婷婷综合| 国产精品不卡在线| 国产精品嫩草影院av蜜臀| 国产欧美日韩综合精品一区二区| 日韩精品一区在线观看| 日韩一二三四区| 日韩欧美第一区| 欧美sm美女调教| 精品久久久网站| 久久婷婷久久一区二区三区| 久久久综合九色合综国产精品| 欧美精品一区二| 久久精品在这里| 亚洲国产高清aⅴ视频| 欧美—级在线免费片| 中文字幕一区二区视频| 亚洲另类中文字| 亚洲丶国产丶欧美一区二区三区| 五月天婷婷综合| 蜜桃在线一区二区三区| 国产制服丝袜一区| 国v精品久久久网| 99久久夜色精品国产网站| 日本久久精品电影| 欧美一区二区三区电影| 久久久久久久久97黄色工厂| 亚洲国产精华液网站w| 一区二区三区在线不卡| 日韩黄色一级片| 国产精一区二区三区| www.一区二区| 欧美巨大另类极品videosbest| 日韩久久精品一区| 国产精品美女www爽爽爽| 一区二区三区四区在线播放| 免费观看成人鲁鲁鲁鲁鲁视频| 精品亚洲免费视频| 97久久超碰国产精品电影| 在线不卡一区二区| 久久久久久久久久电影| 亚洲综合视频网| 国内精品免费在线观看| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 国产91丝袜在线观看| 97精品电影院| 日韩欧美黄色影院| 亚洲欧洲日产国产综合网| 亚洲第一狼人社区| 精品一区二区三区久久| 91在线观看成人| 欧美一级夜夜爽| 国产精品美女久久久久久久久久久| 午夜视频在线观看一区二区| 国产成都精品91一区二区三| 欧美精品三级在线观看| 中文av字幕一区| 欧美一区二区三区视频在线| 国产精品美女久久久久久久久久久| 午夜欧美视频在线观看| 懂色av噜噜一区二区三区av| 7777精品伊人久久久大香线蕉超级流畅 | 日韩毛片视频在线看| 麻豆专区一区二区三区四区五区| 成人av网址在线| 欧美大白屁股肥臀xxxxxx| 亚洲精品第一国产综合野| 国内精品国产成人| 欧美理论片在线| 亚洲欧洲99久久| 狠狠色狠狠色综合日日91app| 欧美中文字幕亚洲一区二区va在线 | 欧美伦理电影网| 国产精品国产三级国产有无不卡| 日本不卡在线视频| 日本精品裸体写真集在线观看| 久久亚洲综合色| 美腿丝袜亚洲三区| 欧美日韩国产天堂| 亚洲色图.com| 成人精品国产福利| 欧美电影免费观看完整版| 五月天中文字幕一区二区| 日本韩国视频一区二区| 中文字幕欧美一区| 国产成人精品网址| 精品欧美乱码久久久久久1区2区| 亚洲午夜三级在线| 91国产成人在线| 亚洲欧洲在线观看av| 粉嫩aⅴ一区二区三区四区| 久久伊99综合婷婷久久伊| 蜜臀91精品一区二区三区 | 精品久久久久一区| 免费黄网站欧美| 日韩一区二区三区免费看| 日韩国产高清在线| 欧美日韩色综合| 午夜激情综合网| 欧美日韩亚洲综合在线| 一区二区三区精品| 91精品福利视频| 亚洲乱码中文字幕综合| 91亚洲国产成人精品一区二区三| 国产欧美日韩综合| 成人丝袜18视频在线观看| 亚洲国产精品av| 99久久国产免费看| 亚洲精品中文在线影院| 在线视频你懂得一区| 亚洲制服丝袜在线| 欧美日韩一区二区在线观看| 亚洲va欧美va人人爽午夜| 欧美美女一区二区在线观看| 七七婷婷婷婷精品国产| 欧美xxxxxxxx| 国v精品久久久网| 中文成人综合网| 日本高清不卡视频| 亚洲不卡一区二区三区| 粉嫩欧美一区二区三区高清影视| 国产自产v一区二区三区c| 亚洲成人综合视频| 欧美顶级少妇做爰| 蜜桃视频在线观看一区| 国产欧美日韩另类一区| 91在线一区二区三区| 一二三四社区欧美黄| 欧美一区二区三级| 激情五月激情综合网| 国产精品入口麻豆原神| 欧洲人成人精品| 另类综合日韩欧美亚洲| 欧美激情中文不卡| 色综合欧美在线视频区| 丝袜国产日韩另类美女| 久久综合久久综合久久| 99久久久久久| 奇米一区二区三区| 国产嫩草影院久久久久| 91久久精品国产91性色tv| 久久国产剧场电影| 国产精品国产馆在线真实露脸 | 91最新地址在线播放| 婷婷成人激情在线网| 久久婷婷一区二区三区| 91国产精品成人| 黑人精品欧美一区二区蜜桃| 国产精品伦理在线| 欧美日韩国产一二三| 东方欧美亚洲色图在线| 五月婷婷欧美视频| 国产精品久久久久久久裸模| 4438亚洲最大| 成人av在线影院| 麻豆久久久久久久| 亚洲欧美经典视频| 精品少妇一区二区三区在线播放 | 免费黄网站欧美| 亚洲欧美日韩成人高清在线一区| 欧美一级搡bbbb搡bbbb| 波多野结衣中文字幕一区| 视频一区二区中文字幕| 国产精品家庭影院| 精品国产伦理网| 在线看国产日韩| 国产乱人伦精品一区二区在线观看| 一区二区三区中文在线| 国产欧美视频一区二区| 日韩欧美中文字幕公布| 欧美午夜在线观看| 国产成人在线免费观看| 日韩黄色免费电影| 亚洲欧美怡红院| 久久精品人人爽人人爽| 色综合久久中文综合久久97| 日本不卡一区二区三区高清视频| 亚洲欧美日韩系列| 久久精品人人做人人综合 | 亚洲3atv精品一区二区三区| 欧美国产日本韩| 久久综合色8888| 日韩亚洲欧美综合| 欧美日韩免费不卡视频一区二区三区| 成人精品小蝌蚪| 国产成人一区在线| 久久精品国产精品亚洲综合| 亚洲第一福利视频在线| 亚洲人成网站色在线观看| 日本一区二区三区高清不卡| 精品国产三级电影在线观看| 91麻豆精品国产91久久久使用方法 | 亚洲大片免费看| 亚洲精品videosex极品| 国产精品青草综合久久久久99| 久久久久久久久久久久久久久99| 日韩欧美中文字幕精品| 日韩三级在线观看| 欧美精品第一页| 欧美人动与zoxxxx乱|