Jump to content

UCT_24

Members
  • Content Count

    17
  • Joined

  • Last visited

Everything posted by UCT_24

  1. Hello, i have a question on the general structure of RAD Studio Builder projects and packages. 1. I can define controls as child-classes of TCustomControl for usage in Forms I create later on. The .bpl holding the Components can and has to be installed via the IDE. Thus, the Components are installed within the package. 2. Those Components can be used in dialogs belonging to the same package the components are installed with and/or in dialogs belonging to other packages or applications. My question is, if it is somehow discouraged to use the components on forms within the same package they are installed with. I hope it got clear what i intend to ask. Thanks for reading this and kind regards,
  2. UCT_24

    Packages and Package structure

    Hello, thanks for your answers, it really helped me understanding the issues. Thanks and have a good day!
  3. UCT_24

    Packages and Package structure

    Hello and thanks for the input on the matter. It really helps. I was wondering if the structure is making trouble with compiling/IDE more likely at least. Yes, the dialogs are used from other packages once more.
  4. UCT_24

    Packages and Package structure

    Hi Anders, thanks for your answer. I guess that is the cause of the issue, as to "use them in the designer" is the difference from any other "usual" class to a "Custom Component" as i have to deal with. However this answer gives me hint at least. Thanks a lot, Ulrich
  5. UCT_24

    Packages and Package structure

    Hello, thanks for your answer. I will try to clarify my question. Say, i have created a Custom Control, a kind of Grid or such. It is part of a package i have created. Within the same package i have several Dialogs that use this control. Can this lead to problems in any way, or would it be better to have the package defining the custom control "installed" (to use in the designer as the built in controls) and make a seperate package for the dialogs? I mean that "compiling the forms" and "installing the package" might interfere somehow, or can this not happen? Though this technically works, i have quite frequently troubles compiling ( internal compiler errors ) and installing (runtime errors of various kinds, mostly by "rtl280.bpl/dll (or simillar)" which are not really reproducible. Thanks a lot and kind regards,
  6. Hello everybody, i am wondering if a Control can have a specific EventHandler. I mean the following: If a Control has a certain "Event", i can implement an Event Handler for the Form which holds the Control. I wonder if it possible to implement the Event handler as a method of the Component class and thus, the Event is handled by each instance of this component on any Form i use this Component class on (without implementing an event handler on every Form for every Instance, hope it is possible to understand what i am aiming at.) I have never seen such thing. If this is possible, can someone maybe advise me an example how this can be done? Thanks a lot and kind regards, UCT
  7. UCT_24

    Can Control Elements have "EventHandlers"?

    Hello, thanks again for your reply. It should be the first case: So, i think this will help me out, thanks a lot and kind regards. UTC
  8. UCT_24

    Can Control Elements have "EventHandlers"?

    Thanks, so if i can identify the method corresponding to the event and override it, i can put some "custom code" there. I will try so. Can you in addition tell me if i can access a components parent form in the method of the component? This would help me a lot. Thanks
  9. UCT_24

    TreeView Grid lines

    Hello everybody, i am wondering if there is a property to control the appearance of TreeView Grid-lines in the VCL. The TTreeView Component has some properties like "LineMode" and "LineStyle", as well some "Colors" properties, but all these don't seem to affect the instance i want to change. Is there maybe some property that "disables/overrides" Color and Line settings? I am using C++ builder, Embarcadero® RAD Studio 11 (hoping this is enough info) Thank you very much in advance and kind regards, Ulrich
  10. UCT_24

    TreeView Grid lines

    Hi all, thanks for your replies. It seems i missed the "TreeOptions -> "Paint Options" in the Object inspector. Sorry for this. What was trying to was: 1.: Show grid lines in my Tree view 2.: Choose a color for those grid lines In the "Paint Options" you find "toShowVertGridLines" and "toShowHorzGridLines". Activating those does the trick. There is also a GridLineColor given under "Colors" in the Object inspector. Thanks a lot and kind regards, Ulrich
  11. 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
  12. 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
  13. 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
  14. 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.
  15. 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
  16. 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
  17. 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
×