요즘 베트남어로 된 프로그램 만들며 메뉴를 기존 소스에서 가져와 뿌려 줬는데..
확인해 보니.. 헉.. 깨져서 나오네요..
다른 곳은 전부 잘 되는데.. 메뉴만 그러네요..
TMainMenu 이넘이 문제인지 아님.. 제가 잘 못한건지.. 쩝..
<!--CodeS-->
procedure TfrmMainMenu.DrawMenu;
var
aParent, aChild: TMenuItem;
j, i, Menu_DISP: LongInt;
fResult, fIndex, fPermission,BCaption: String;
begin
with qrMain do begin
Close;
Sql.Clear;
Sql.Add('Select * from Menu');
Sql.Add(' Where Gubun = 0 ');
Sql.Add(' And Item = -1 ');
Open;
First;
while not EOF do begin
aParent:= TMenuItem.Create(Self);
with aParent do begin
Caption:= FieldByName('Caption').AsString;
end;
with mnuMenu do begin
Items.Add(aParent);
end;
with qrSub do begin
Close;
Sql.Clear;
Sql.Add('Select * from Menu');
Sql.Add(' Where Gubun = 0 ');
Sql.Add(' And Item <> -1 ');
Sql.Add(' And Inde_ = ''' + qrMain.FieldByName('Inde_').AsString + '''');
Open;
First;
while not EOF do begin
aChild:= TMenuItem.Create(Self);
if FieldbyName('idx1').AsString <> '0' then
fIndex:= Copy(fPermission, FieldbyName('idx1').AsInteger, 1)
else fIndex:= '0';
if qrSub.FieldbyName('Path').AsString = 'CLOSE' then fIndex:= '0'; //강제 SETUP 작업종료시
Menu_DISP:=1;
if (qrSub.FieldByName('Caption').AsString='-') then begin
if Bcaption='' then Menu_DISP:=0
else if (Bcaption = qrSub.FieldByName('Caption').AsString) then Menu_DISP:=0;
end;
if (Menu_DISP=1) then begin //실행가능 메뉴이면
with aChild do begin
if (FieldByName('Caption').AsString <> '-') and (FieldByName('Path').AsString <> 'CLOSE') then begin
// FieldbyName('idx1').AsString+' '+
Caption:= FieldByName('Caption').AsString;
Tag := FieldbyName('idx1').AsInteger;
end else begin
Caption:= FieldByName('Caption').AsString;
Tag := 0;
end;
OnClick:= MenuItemClick;
if (FieldByName('Path').AsString <> '') then aChild.Checked:= False
else aChild.Checked:= True;
if (aChild.Checked = False) and (fResult = '0') then begin
if aChild.checked = False then aChild.Checked:= true;
end;
end;
aParent.Add(aChild);
BCaption:=qrSub.FieldByName('Caption').AsString
end;
Next;
end;
end;
Next;
end;
end;
end;
<!--CodeE-->
아무리 생각해도 이상하네요. Delphi 2009이상에서는 unicode를 지원한다고 들었는데
TMainmenu만 안나온다니...