You are not logged in.
Hello again!
Some time ago the problem occurred that array of resourcestrings can't be used in units inside packages. You solved that by using arrays of strings instead, e.g.
const
TD_BTNS: array[TCommonButton] of string = (
SMsgDlgOK, SMsgDlgYes, SMsgDlgNo, SMsgDlgCancel, SMsgDlgRetry,
SCloseButton);
instead of
const
TD_BTNS: array[TCommonButton] of pointer = (
@SMsgDlgOK, @SMsgDlgYes, @SMsgDlgNo, @SMsgDlgCancel, @SMsgDlgRetry,
@SCloseButton);
Unfortunately we have to assign the resourcestrings at runtime (with HookResourceString or similar), so this doesn't work. An alternative solution considered back then was using functions like
function TD_BTNS(cb: TCommonButton): Pointer;
begin
case cb of
cbOK: Result := @SMsgDlgOK;
cbYes: Result := @SMsgDlgYes;
cbNo: Result := @SMsgDlgNo;
cbCancel: Result := @SMsgDlgCancel;
cbRetry: Result := @SMsgDlgRetry;
cbClose: Result := @SCloseButton;
else Result := nil;
end;
end;
which seem to work under these circumstances. What do you think about changing this?
Cheers,
Uli
Offline
Nice.
It allows indeed on-the fly translation of resource strings for SynTaskDialog.
See http://synopse.info/fossil/info/a021423994
Thanks for the proposal!
Offline
Cool. I'm gonna make use of that as soon as time permits. :-)
Offline