2016년 1월 15일 금요일

Popup Menu Font 바꾸기

PopUpMenu1.OwnerDwar := True; 를 먼저 하고,
Screen.MenuFont.Name := frmStudyLaw2.Font.Name;
Screen.MenuFont.Size:= 11;   // frmStudyLaw2.Font.Size;
Screen.CaptionFont:= frmStudyLaw2.Font;
만약 폰트가 영역을 넘치면
So assign a handler for OnMeasureItem of the items of the popup menu either at design time, or at run time:
puMenuMain.OwnerDraw:=True;
Screen.MenuFont.Size:=18; 
for i := 0 to puMain.Items.Count - 1 do
  puMain.Items[i].OnMeasureItem := PopupMeasureItem;
where PopupMeasureItem can be as simple as
procedure TMyForm.PopupMeasureItem(Sender: TObject; ACanvas: TCanvas;
  var Width,   Height: Integer); 
begin
  Height := ACanvas.TextHeight('.') + 2;
end;
or you can determine the necessary height as the user selects from the list to save calling TextHeight each time an item is to be drawn.

델파이의 부활(Antigravity와의 만남)?

 델파이 프로그램을 사용하여 개인적으로 필요한 프로그램을 생성해 왔는데, 얼마전부터 파이썬으로 옮겨갔다.  그런데 Google 의 Antigravity를 만나고 나서 델파이에 대한 미련을 버리지 못해  제미나이가 Delphi이에 대한 학습도 엄청 했을...