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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tntmenus.pas

?? TNT Components Source
?? PAS
?? 第 1 頁 / 共 3 頁
字號:
        or Assigned(Item.OnAdvancedDrawItem)
        or ItemHasValidImage(Item) then
          Continue;
        Info.fMask:= MIIM_FTYPE or MIIM_STRING;
        Info.fType:= (Info.fType and not MFT_OWNERDRAW) or MFT_STRING;
        if Win32PlatformIsUnicode and (Item is TTntMenuItem) then begin
          // Unicode
          TMenuItemInfoW(Info).dwTypeData:= PWideChar(TTntMenuItem(Item).Caption);
          SetMenuItemInfoW(HM, i, true, TMenuItemInfoW(Info));
        end else begin
          // Ansi
          Info.dwTypeData:= PAnsiChar(Item.Caption);
          SetMenuItemInfoA(HM, i, true, Info);
        end;
      end;
    end;
  end;
end;

{ TTntMenuItem's utility procs }

procedure SyncHotKeyPosition(const Source: WideString; var Dest: WideString);
var
  I: Integer;
  FarEastHotString: WideString;
begin
  if (AnsiString(Source) <> AnsiString(Dest))
  and WideSameCaptionStr(AnsiString(Source), AnsiString(Dest)) then begin
    // when reduced to ansi, the only difference is hot key positions
    Dest := WideStripHotkey(Dest);
    I := 1;
    while I <= Length(Source) do
    begin
      if Source[I] = cHotkeyPrefix then begin
        if SysLocale.FarEast
        and ((I > 1) and (Length(Source) - I >= 2)
        and (Source[I - 1] = '(') and (Source[I + 2] = ')')) then begin
          FarEastHotString := Copy(Source, I - 1, 4);
          Dec(I);
          Insert(FarEastHotString, Dest, I);
          Inc(I, 3);
        end else begin
          Insert(cHotkeyPrefix, Dest, I);
          Inc(I);
        end;
      end;
      Inc(I);
    end;
    // test work
    if AnsiString(Source) <> AnsiString(Dest) then
      raise ETntInternalError.CreateFmt('Internal Error: SyncHotKeyPosition Failed ("%s" <> "%s").',
        [AnsiString(Source), AnsiString(Dest)]);
  end;
end;

procedure UpdateMenuItems(Items: TMenuItem{TNT-ALLOW TMenuItem}; ParentMenu: TMenu);
var
  i: integer;
begin
  if (Items.ComponentState * [csReading, csDestroying] = []) then begin
    for i := Items.Count - 1 downto 0 do
      UpdateMenuItems(Items[i], ParentMenu);
    if Items is TTntMenuItem then
      TTntMenuItem(Items).UpdateMenuString(ParentMenu);
  end;
end;

procedure FixMenuBiDiProblem(Menu: TMenu);
var
  i: integer;
begin
  // TMenu sometimes sets bidi on first visible item which can convert caption to ansi
  if (SysLocale.MiddleEast)
  and (Menu <> nil)
  and (Menu.Items.Count > 0) then
  begin
    for i := 0 to Menu.Items.Count - 1 do begin
      if Menu.Items[i].Visible then begin
        if (Menu.Items[i] is TTntMenuItem) then
          (Menu.Items[i] as TTntMenuItem).UpdateMenuString(Menu);
        break; // found first visible menu item!
      end;
    end;
  end;
end;


{$IFDEF COMPILER_6} // verified against VCL source in Delphi 6 and BCB 6
type
  THackMenuItem = class(TComponent)
  protected
    FxxxxCaption: Ansistring;
    FxxxxHandle: HMENU;
    FxxxxChecked: Boolean;
    FxxxxEnabled: Boolean;
    FxxxxDefault: Boolean;
    FxxxxAutoHotkeys: TMenuItemAutoFlag;
    FxxxxAutoLineReduction: TMenuItemAutoFlag;
    FxxxxRadioItem: Boolean;
    FxxxxVisible: Boolean;
    FxxxxGroupIndex: Byte;
    FxxxxImageIndex: TImageIndex;
    FxxxxActionLink: TMenuActionLink{TNT-ALLOW TMenuActionLink};
    FxxxxBreak: TMenuBreak;
    FBitmap: TBitmap;
    FxxxxCommand: Word;
    FxxxxHelpContext: THelpContext;
    FxxxxHint: AnsiString;
    FxxxxItems: TList;
    FxxxxShortCut: TShortCut;
    FxxxxParent: TMenuItem{TNT-ALLOW TMenuItem};
    FMerged: TMenuItem{TNT-ALLOW TMenuItem};
    FMergedWith: TMenuItem{TNT-ALLOW TMenuItem};
  end;
{$ENDIF}
{$IFDEF DELPHI_7} // verified against VCL source in Delphi 7
type
  THackMenuItem = class(TComponent)
  protected
    FxxxxCaption: AnsiString;
    FxxxxHandle: HMENU;
    FxxxxChecked: Boolean;
    FxxxxEnabled: Boolean;
    FxxxxDefault: Boolean;
    FxxxxAutoHotkeys: TMenuItemAutoFlag;
    FxxxxAutoLineReduction: TMenuItemAutoFlag;
    FxxxxRadioItem: Boolean;
    FxxxxVisible: Boolean;
    FxxxxGroupIndex: Byte;
    FxxxxImageIndex: TImageIndex;
    FxxxxActionLink: TMenuActionLink{TNT-ALLOW TMenuActionLink};
    FxxxxBreak: TMenuBreak;
    FBitmap: TBitmap;
    FxxxxCommand: Word;
    FxxxxHelpContext: THelpContext;
    FxxxxHint: AnsiString;
    FxxxxItems: TList;
    FxxxxShortCut: TShortCut;
    FxxxxParent: TMenuItem{TNT-ALLOW TMenuItem};
    FMerged: TMenuItem{TNT-ALLOW TMenuItem};
    FMergedWith: TMenuItem{TNT-ALLOW TMenuItem};
  end;
{$ENDIF}
{$IFDEF DELPHI_9} // verified against VCL source in Delphi 9
type
  THackMenuItem = class(TComponent)
  protected
    FxxxxCaption: AnsiString;
    FxxxxHandle: HMENU;
    FxxxxChecked: Boolean;
    FxxxxEnabled: Boolean;
    FxxxxDefault: Boolean;
    FxxxxAutoHotkeys: TMenuItemAutoFlag;
    FxxxxAutoLineReduction: TMenuItemAutoFlag;
    FxxxxRadioItem: Boolean;
    FxxxxVisible: Boolean;
    FxxxxGroupIndex: Byte;
    FxxxxImageIndex: TImageIndex;
    FxxxxActionLink: TMenuActionLink{TNT-ALLOW TMenuActionLink};
    FxxxxBreak: TMenuBreak;
    FBitmap: TBitmap;
    FxxxxCommand: Word;
    FxxxxHelpContext: THelpContext;
    FxxxxHint: AnsiString;
    FxxxxItems: TList;
    FxxxxShortCut: TShortCut;
    FxxxxParent: TMenuItem{TNT-ALLOW TMenuItem};
    FMerged: TMenuItem{TNT-ALLOW TMenuItem};
    FMergedWith: TMenuItem{TNT-ALLOW TMenuItem};
  end;
{$ENDIF}
{$IFDEF DELPHI_10} // verified against VCL source in Delphi 10
type
  THackMenuItem = class(TComponent)
  protected
    FxxxxCaption: AnsiString;
    FxxxxHandle: HMENU;
    FxxxxChecked: Boolean;
    FxxxxEnabled: Boolean;
    FxxxxDefault: Boolean;
    FxxxxAutoHotkeys: TMenuItemAutoFlag;
    FxxxxAutoLineReduction: TMenuItemAutoFlag;
    FxxxxRadioItem: Boolean;
    FxxxxVisible: Boolean;
    FxxxxGroupIndex: Byte;
    FxxxxImageIndex: TImageIndex;
    FxxxxActionLink: TMenuActionLink{TNT-ALLOW TMenuActionLink};
    FxxxxBreak: TMenuBreak;
    FBitmap: TBitmap;
    FxxxxCommand: Word;
    FxxxxHelpContext: THelpContext;
    FxxxxHint: AnsiString;
    FxxxxItems: TList;
    FxxxxShortCut: TShortCut;
    FxxxxParent: TMenuItem{TNT-ALLOW TMenuItem};
    FMerged: TMenuItem{TNT-ALLOW TMenuItem};
    FMergedWith: TMenuItem{TNT-ALLOW TMenuItem};
  end;
{$ENDIF}

function MenuItemHasBitmap(MenuItem: TMenuItem{TNT-ALLOW TMenuItem}): Boolean;
begin
  Result := Assigned(THackMenuItem(MenuItem).FBitmap);
end;

{ TTntMenuItem }

procedure TTntMenuItem.DefineProperties(Filer: TFiler);
begin
  inherited;
  TntPersistent_AfterInherited_DefineProperties(Filer, Self);
end;

type TAccessActionlink = class(TActionLink);

procedure TTntMenuItem.InitiateAction;
begin
  if GetKeyboardLayout(0) <> FKeyboardLayout then
    MenuChanged(False);
  inherited;
end;

function TTntMenuItem.IsCaptionStored: Boolean;
begin
  Result := (ActionLink = nil) or (not TAccessActionlink(ActionLink).IsCaptionLinked);
end;

procedure TTntMenuItem.SetInheritedCaption(const Value: AnsiString);
begin
  inherited Caption := Value;
end;

function TTntMenuItem.GetCaption: WideString;
begin
  if (AnsiString(FCaption) <> inherited Caption)
  and WideSameCaptionStr(AnsiString(FCaption), inherited Caption) then
  begin
    // only difference is hotkey position, update caption with new hotkey position
    SyncHotKeyPosition(inherited Caption, FCaption);
  end;
  Result := GetSyncedWideString(FCaption, (inherited Caption));
end;

procedure TTntMenuItem.SetCaption(const Value: WideString);
begin
  GetCaption; // auto adjust for hot key changes
  SetSyncedWideString(Value, FCaption, (inherited Caption), SetInheritedCaption);
end;

function TTntMenuItem.GetHint: WideString;
begin
  Result := GetSyncedWideString(FHint, inherited Hint);
end;

procedure TTntMenuItem.SetInheritedHint(const Value: AnsiString);
begin
  inherited Hint := Value;
end;

procedure TTntMenuItem.SetHint(const Value: WideString);
begin
  SetSyncedWideString(Value, FHint, inherited Hint, SetInheritedHint);
end;

function TTntMenuItem.IsHintStored: Boolean;
begin
  Result := (ActionLink = nil) or not TAccessActionlink(ActionLink).IsHintLinked;
end;

procedure TTntMenuItem.Loaded;
begin
  inherited;
  UpdateMenuString(GetParentMenu);
end;

procedure TTntMenuItem.MenuChanged(Rebuild: Boolean);
begin
  if (not FIgnoreMenuChanged) then begin
    inherited;
    UpdateMenuItems(Self, GetParentMenu);
    FixMenuBiDiProblem(GetParentMenu);
  end;
end;

procedure TTntMenuItem.UpdateMenuString(ParentMenu: TMenu);
var
  ParentHandle: THandle;

  function NativeMenuTypeIsString: Boolean;
  var
    MenuItemInfo: TMenuItemInfoW;
    Buffer: array[0..79] of WideChar;
  begin
    MenuItemInfo.cbSize := 44; // Required for Windows NT 4.0
    MenuItemInfo.fMask := MIIM_TYPE;
    MenuItemInfo.dwTypeData := Buffer; // ??
    MenuItemInfo.cch := Length(Buffer); // ??
    Result := GetMenuItemInfoW(ParentHandle, Command, False, MenuItemInfo)
         and ((MenuItemInfo.fType and (MFT_BITMAP or MFT_SEPARATOR or MFT_OWNERDRAW)) = 0)
  end;

  function NativeMenuString: WideString;
  var
    Len: Integer;
  begin
    Assert(Win32PlatformIsUnicode);
    Len := GetMenuStringW(ParentHandle, Command, nil, 0, MF_BYCOMMAND);
    if Len = 0 then
      Result := ''
    else begin
      SetLength(Result, Len + 1);
      Len := GetMenuStringW(ParentHandle, Command, PWideChar(Result), Len + 1, MF_BYCOMMAND);
      SetLength(Result, Len);
    end;
  end;

  procedure SetMenuString(const Value: WideString);
  var
    MenuItemInfo: TMenuItemInfoW;
    Buffer: array[0..79] of WideChar;
  begin
    MenuItemInfo.cbSize := 44; // Required for Windows NT 4.0
    MenuItemInfo.fMask := MIIM_TYPE;
    MenuItemInfo.dwTypeData := Buffer; // ??
    MenuItemInfo.cch := Length(Buffer); // ??
    if GetMenuItemInfoW(ParentHandle, Command, False, MenuItemInfo)
    and ((MenuItemInfo.fType and (MFT_BITMAP or MFT_SEPARATOR or MFT_OWNERDRAW)) = 0) then
    begin
      MenuItemInfo.dwTypeData := PWideChar(Value);
      MenuItemInfo.cch := Length(Value);
      Win32Check(SetMenuItemInfoW(ParentHandle, Command, False, MenuItemInfo));
    end;
  end;

  function SameEvent(A, B: TMenuMeasureItemEvent): Boolean;
  begin
    Result := @A = @B;
  end;

var
  MenuCaption: WideString;
begin
  FKeyboardLayout := GetKeyboardLayout(0);
  if Parent = nil then
    ParentHandle := 0
  else if (THackMenuItem(Self.Parent).FMergedWith <> nil) then
    ParentHandle := THackMenuItem(Self.Parent).FMergedWith.Handle
  else
    ParentHandle := Parent.Handle;

  if (Win32PlatformIsUnicode)
  and (Parent <> nil) and (ParentMenu <> nil)
  and (ComponentState * [csReading, csDestroying] = [])
  and (Visible)
  and (NativeMenuTypeIsString) then begin
    MenuCaption := Caption;
    if (Count = 0)
    and ((ShortCut <> scNone)
    and ((Parent = nil) or (Parent.Parent <> nil) or not (Parent.Owner is TMainMenu{TNT-ALLOW TMainMenu}))) then
      MenuCaption := MenuCaption + #9 + WideShortCutToText(ShortCut);
    if (NativeMenuString <> MenuCaption) then
    begin
      SetMenuString(MenuCaption);
      if  ((Parent = ParentMenu.Items) or (THackMenuItem(Self.Parent).FMergedWith <> nil))
      and (ParentMenu is TMainMenu{TNT-ALLOW TMainMenu})
      and (ParentMenu.WindowHandle <> 0) then
        DrawMenuBar(ParentMenu.WindowHandle) {top level menu bar items}
    end;
  end;
end;

function TTntMenuItem.GetAlignmentDrawStyle: Word;
const
  Alignments: array[TPopupAlignment] of Word = (DT_LEFT, DT_RIGHT, DT_CENTER);
var
  ParentMenu: TMenu;
  Alignment: TPopupAlignment;
begin
  ParentMenu := GetParentMenu;
  if ParentMenu is TMenu then
    Alignment := paLeft
  else if ParentMenu is TPopupMenu{TNT-ALLOW TPopupMenu} then
    Alignment := TPopupMenu{TNT-ALLOW TPopupMenu}(ParentMenu).Alignment

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一二三在线| 首页国产欧美久久| 亚洲福利电影网| 免费一级片91| 在线播放亚洲一区| 日精品一区二区三区| 欧美精三区欧美精三区| 亚洲九九爱视频| 欧美日韩欧美一区二区| 亚洲摸摸操操av| 中文字幕一区三区| 日韩二区在线观看| 91成人在线精品| 中文字幕亚洲成人| 成人动漫中文字幕| 中文字幕第一区| 丁香桃色午夜亚洲一区二区三区| 欧美老肥妇做.爰bbww视频| 国产精品乱码人人做人人爱| 国产真实精品久久二三区| 欧美精品aⅴ在线视频| 午夜久久久久久| 欧美在线你懂得| 亚洲精品成人精品456| 久久精品国产精品亚洲精品| 欧美精品自拍偷拍动漫精品| 亚洲va韩国va欧美va| 欧美午夜不卡在线观看免费| 一区二区三区精品视频在线| 欧美专区日韩专区| 天堂久久一区二区三区| 日韩一区二区免费视频| 日日欢夜夜爽一区| 久久亚洲综合色| hitomi一区二区三区精品| 亚洲欧美在线高清| 91福利区一区二区三区| 亚洲国产另类精品专区| 久久综合精品国产一区二区三区| 成人免费视频一区| 丝袜美腿成人在线| 国产精品久久久久精k8| 99精品久久99久久久久| 男人的j进女人的j一区| 日本一区二区免费在线观看视频| 成人av电影免费在线播放| 亚洲成人av一区二区| 久久久久久久久久看片| 色呦呦一区二区三区| 日韩成人午夜电影| 国产精品国产三级国产aⅴ中文 | 国产a精品视频| 一区二区高清视频在线观看| 精品电影一区二区| 色94色欧美sute亚洲线路一久| 另类欧美日韩国产在线| 久久精品视频免费| 91精品婷婷国产综合久久性色 | 欧美日韩在线精品一区二区三区激情| 六月丁香婷婷久久| 中文字幕日韩精品一区| 精品久久人人做人人爽| 色综合久久久久综合99| 国产成人免费视频网站| 蜜桃久久久久久| 亚洲综合清纯丝袜自拍| 久久久久高清精品| 欧美一区二区免费观在线| 91久久精品网| 91成人免费在线| 99精品国产热久久91蜜凸| 国产精品亚洲а∨天堂免在线| 麻豆传媒一区二区三区| 亚洲美腿欧美偷拍| 亚洲欧洲国产日韩| 国产精品大尺度| 中文字幕不卡在线| 日本一区二区三区四区在线视频 | 国产午夜精品久久久久久免费视| 日韩一区和二区| 9191国产精品| 欧美福利视频导航| 欧美一区二区三区精品| 欧美区在线观看| 欧美一级高清大全免费观看| 911国产精品| 欧美精品在线观看一区二区| 欧美日韩国产高清一区二区三区| 欧洲亚洲国产日韩| 在线电影一区二区三区| 7777精品伊人久久久大香线蕉超级流畅| 91亚洲永久精品| 7777精品伊人久久久大香线蕉 | 欧美一区二区三区日韩| 欧美mv和日韩mv的网站| 国产网红主播福利一区二区| 国产精品久久久久9999吃药| 中文字幕在线观看不卡视频| 亚洲欧洲国产日韩| 五月婷婷综合网| 国产精品一二三四| 欧美日韩美少妇| 久久综合九色综合97婷婷| 欧美国产综合一区二区| 亚洲午夜一区二区| 精品亚洲成a人| 欧美性欧美巨大黑白大战| 欧美二区在线观看| 国产日韩欧美精品一区| 一区二区三区四区五区视频在线观看| 日韩va亚洲va欧美va久久| 成人av在线网站| 日韩精品一区二区三区老鸭窝| 精品国产凹凸成av人网站| 亚洲人123区| 国产盗摄女厕一区二区三区| 91小视频在线| 国产欧美精品一区二区三区四区| 亚洲午夜免费视频| 97精品视频在线观看自产线路二| 欧美一区欧美二区| 亚洲六月丁香色婷婷综合久久 | 欧美一级日韩不卡播放免费| 国产精品嫩草久久久久| 精品一区二区三区免费| 欧美日韩1区2区| 亚洲免费在线观看视频| 国产ts人妖一区二区| 欧美电影免费观看高清完整版| 中文字幕一区在线观看视频| 日韩国产精品久久| 欧美亚洲综合网| 一区二区三区不卡视频在线观看 | 欧美视频精品在线观看| 欧美激情在线看| 国产aⅴ综合色| 中文字幕精品一区二区三区精品| 青青草伊人久久| 日韩欧美一区二区免费| 日本系列欧美系列| 久久久五月婷婷| 99国产精品视频免费观看| 一区二区三区免费网站| 欧美肥妇毛茸茸| 国产成人在线色| 夜夜夜精品看看| 精品国产区一区| 91免费看`日韩一区二区| 亚洲高清在线视频| 久久看人人爽人人| 91麻豆国产福利在线观看| 丝袜美腿高跟呻吟高潮一区| 精品国产免费一区二区三区香蕉| 国产激情一区二区三区| 一区二区三区在线视频免费| 51精品视频一区二区三区| 成人一区二区三区中文字幕| 一区二区三区在线免费视频 | 一区二区三区欧美视频| 久久色在线视频| 欧美性一级生活| 高清beeg欧美| 极品美女销魂一区二区三区| 亚洲另类春色国产| 国产日韩欧美麻豆| 欧美tickle裸体挠脚心vk| 色老头久久综合| 成人一区二区在线观看| 黄页视频在线91| 亚洲大片精品永久免费| 成人欧美一区二区三区黑人麻豆| 精品国产乱码久久久久久夜甘婷婷 | 蜜桃久久av一区| 天堂午夜影视日韩欧美一区二区| 亚洲欧洲韩国日本视频| 久久久久青草大香线综合精品| 欧美日韩国产精品自在自线| 色综合天天做天天爱| 97se亚洲国产综合自在线| 国产成人午夜精品影院观看视频| 久久99精品国产麻豆不卡| 亚洲国产欧美在线人成| 亚洲国产精品视频| 亚洲综合色区另类av| 亚洲一二三四在线| 一卡二卡欧美日韩| 亚洲国产精品嫩草影院| 亚洲午夜免费电影| 日韩高清一区在线| 毛片一区二区三区| 加勒比av一区二区| 粉嫩久久99精品久久久久久夜| 国产精品 日产精品 欧美精品| 国产一区免费电影| 国产成人午夜电影网| eeuss鲁一区二区三区| 99精品一区二区| 欧美日韩三级在线| 日韩一区二区在线看| 欧美精品一区男女天堂|