vcl

Modifying VCL Component CODE

a 夏天 提交于 2020-01-03 17:32:08
问题 I need to change the functionality in a component. What do you do when you get a "you can't override this" message, or you need to change the code in a private method ("method does not exist in base class" message), rendering it impossible to descend the component? 回答1: If I face that problem, I first try to inherit from the component, or its CustomXXX ancestor and see if that fixes the problem. If that doesn't, I go deeper, i.e. try to intercept the messages that come in. That can be done

Using VCL Styles gives a exception / crash in TOpenDialog

≡放荡痞女 提交于 2020-01-03 02:41:13
问题 I am experiencing a crash / exception when using a simple TOpenDialog with VCL Styles enabled. Without the styles enabled, the dialog is of course working fine. The issue occurs with C++ Builder 10 and 10.1 Professional. To reproduce: create a simpe VCL Form that uses styles add a TComboBox, a TButton and a TOpenDialog to the form add the following code to the OnClick event for the button OpenDialog1->Execute(); for(int i=0; i<100; i++) ComboBox1->Items->Add("test text"); ComboBox1->ItemIndex

Why shouldn't you use a handle during component creation or streaming?

别等时光非礼了梦想. 提交于 2020-01-01 12:08:30
问题 I want to make a custom VCL control that wraps a SDL rendering surface via the SDL_CreateWindowFrom function. SDL_CreateWindowFrom takes an existing HWND handle and puts a high-performance rendering context (it has several backends available, including DirectX and OpenGL) onto it. The helpfile says "Do not refer to the Handle property during component creation or streaming." But it doesn't say why. It says that the first time you try to access the Handle property, it'll call HandleNeeded to

How can I create alpha blended icon/cursor (indirect) from the TBitmap instance of 32 bpp w/o making an temporary DIB section?

℡╲_俬逩灬. 提交于 2020-01-01 05:36:12
问题 According to MS KB entry, there is a quirk in CreateIconIndirect which recognizes HBITMAP s been created with BITMAPV5HEADER passed to CreateDIBSection (and BGRA channel layout). However, TBitmap instances with (PixelFormat = pf32bit) and (AlphaFormat = afDefined) (behaving as alpha blended for the other purposes) when referred by its Handle s are not being recognized as valid alpha blended bitmaps for creation of icons or cursors. Currently, I have to create a full copy of TBitmap using

Creating a new component by combining two controls (TEdit and TTrackBar) in Delphi VCL

假如想象 提交于 2019-12-30 18:24:08
问题 I am developing a Delphi 10.1 VCL application for Windows. For integer or float input I need a number input field which is connected with a slider. When the user changes the number in the input field the slider position changes accordingly. When the user changes the slider position the number in the number field is updated. I can solve this by using a TEdit and a TTrackBar and add the necessary update functionality in their OnChange event handlers. The problem is that I need many of such

How add Delphi XE2 64bit support to a simple Delphi XE2 32bit VCL component?

只愿长相守 提交于 2019-12-30 05:53:06
问题 I need convert a VCL component from 32bit to 64bit (Delphi XE2). Now infact I can install it only if I select "32bit Platform", if I select "64bit Platform" I can compile it but not install (there is not the install menu). How can I add 64bit support and install it for 64bit application? 回答1: If you mean "install it into the IDE", the simple answer is that you cannot. The IDE is a 32-bit application and is not designed to host 64-bit DLL's. Any components or plug-ins must be compiled for 32

What's the difference between Refresh, Update and Repaint?

假如想象 提交于 2019-12-29 03:17:25
问题 I don't know which of those three methods suits me most. They all work for me. Does anyone know the difference between Refresh, Update and Repaint? 回答1: According to the online documentation. Refresh - Repaints the control on the screen. Call Refresh method to repaint the control immediately. Refresh calls the Repaint method. Use the Refresh and Repaint methods interchangeably. Repaint - Forces the control to repaint its image on the screen. Call Repaint to force the control to repaint its

Delphi: override an assignment proc for components property in Object Inspector

蹲街弑〆低调 提交于 2019-12-26 02:57:00
问题 I have a component i.e. TBrandNewComponent , who has published property Jumbo: TJumboClass , which is: TJumboClass = class P: Pointer end; I had overriden the GetValues procedure to show different components in a list of Jumbos 's values in Object Inspector. Now list shows components of TJumboClass and components of TMassiveClass and TRotefulClass . There is also TBrandNewComponent.JumboSelectedComponentType: integer , which I want to change due to selected component in TBrandNewComponent

Looking for non-rectangular panel VCL component [closed]

家住魔仙堡 提交于 2019-12-24 19:23:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Sometimes I want L-shaped, T-shaped, triangular, polygonal ... Free reusable component please . . . 回答1: It seemed to be too late, but I know a free one on the Angus's site.("Drawing Objects") . (I misunderstood what you need is like non-recutanglular form like TRzShapeForm from your question.) Sorry. (source:

TImageList - True color + alpha channel vs. 8-bit (256 colors)

空扰寡人 提交于 2019-12-24 14:54:11
问题 I use c++ Builder 2009 but I tagged this for Delphi as well since I expect the exact same issue to exist there as well. I use TImageList (16x16) and associate it to TListView (SmallImages) and TTreeView . I was adding new icons via the IDE (design time) and imported some 16x16 True color + alpha channel icons. In the IDE they looked fine: During run time, they do not look fine at all: Notice the edges especially. The top icon is icon 5 and the bottom icon is icon 7. See how they are supposed