Jump to content

UCT_24

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. UCT_24

    "ComponentState" issue?

    Dear all, i do have a problem with cutom components in C++ builder. Every component has a "ComponentState" property, which can be used to determine for example whether a method is called from within designer or at "runtime". In our case we simply have the following if- clause: if ( ! this->ComponentState.Contains( csDesigning ) ) But however, it seems that the ComponentState has a different value from one time to the other, when reaching this line of code in desinger. (I had added a prompt of the Property Value, and opening a form using the component several times ended up in showing different values each time i opened the form... ) Is there a known issue regarding this ComponentState property? Or is it possible that i am misinterpreting the way it can/should be used? Thanks a lot for taking your time, Ulrich
  2. UCT_24

    Localization of VCL Dialogs

    Hello, to your first reply, i was afraid so. However, it totally makes sense, unfortunately. Regarding the BDSSetLang, i will try this when i have the opportunity. Thanks a lot for your kind assistance, it helped me a lot. Kind regards, Ulrich
  3. UCT_24

    Localization of VCL Dialogs

    Hello again, i tried to put a registry key in HKEY_CURRENT_USER\SOFTWARE\Embarcadero\Locales and took the existing keys as example. But using my .exe path as key and "en-GB" as Value (REG_SZ entry) does only affect some, but not all VCL dialogs. The "Vcl.Forms.TApplication.MessageBox" and the "FileChooser (not sure about the exact class name here)" are not affected by the registry key, but the "messageDlg" from the VCl and the Menu-Shortcut Captions are displayed as desired. I tried switching the language set for bds.exe, and this changes the display language of the bds.exe. Maybe i need to perform the steps to apply languages when compiling the application first? However, " SetLocaleOverride" Function does not seem to have an effect.
  4. UCT_24

    Localization of VCL Dialogs

    Ok, so i think my best Option will be to try both and see what works better. I will keep you updated 🙂 Thanks again and kind regards, Ulrich
  5. UCT_24

    Localization of VCL Dialogs

    Thanks for your answers, i'll try that registry key. Switching language at program start might be enough if the language can be read from a configuration file. But, do i get this right, i have to add code to manipulate this registry key right at the entry point of the application? Or will it be necessarry to switch the registry key BEFORE the program is run, because VCL component initialization has already been done when i enter the main routine of the program? Thanks a lot so far and kind regards, Ulrich
  6. UCT_24

    Localization of VCL Dialogs

    Many thanks for your reply, i will check this file. I have read about resource strings before, and i was sure that there are Resource Strings defined for all the standard dialogs. But how to switch between languages at runtime then (assumed i already have resource strings translated)? At the moment, as far as i can see, the VCL will consider the resource strings matching the windows language. Is there a specific function call to "force" a specific language/resource string mapping? Kind regards, ulrich
  7. UCT_24

    Localization of VCL Dialogs

    Hello, i am having trouble "localizing" VCL built-in dialogs. Generally, i think there is multi-language support for the VCL. Also, there are means of localizing custom forms and vcl controls at runtime. But i could not find documentation or examples on how i can have for example the buttons in a "Vcl.Forms.TApplication.MessageBox" displayed with english or german captions? The Captions vary when using the System settings, switching "Windows language", but i would like to switch language "at runtime" of the application, so, if you like. To be more precise: For example i call the MessageBox function and have it displaying one "OK" and one "CANCEL" button. I would like to make sure in application code that the Button Captions are displayed in english or german (independent of the windows language settings). The same applies for the VCL "Dialogs::MessageDlg" buttons. Buttons are added by "System::Uitypes::TMsgDlgBtn"-type idenifiers, but the resulting buttons on the form can not be localized in the described way. This should also apply for "shortcut" caption extensions. For example i add a menu with a TShortCut that is using a key identifier (extern DELPHI_PACKAGE System::Classes::TShortCut __fastcall ShortCut(System::Word Key, System::Classes::TShiftState Shift);). These ShortCuts are displayed on the UI as a "caption extension". But i do not know how to have them displayed according to language chosen at runtime. Is this maybe impossible to switch display language of such controls at runtime? And if possible, does anyone know how to achieve this? Thanks in advance and kind regards, Ulrich
×