vcl

How to “scan” the full list of currently-installed VCL components

折月煮酒 提交于 2019-12-04 12:45:26
问题 I still haven't found a truly satisfactory answer to this question, and am now considering rolling my own. I have ModelMaker and GExperts, and neither seems to load the comprehensive class-hierarchy I am looking for. As well, I don't think the folks at DevExpress will fork over the CDK code which compiles a full class list to inherit from... ;-) SO... If ALL I want to do is build a self-referencing table of all registered component classes (or even all classes including non-components, if

Delphi - Using the TApplicationEvents OnShortCut event to detect Alt+C key presses

杀马特。学长 韩版系。学妹 提交于 2019-12-04 12:24:58
问题 I am using TApplicationEvents OnShortCut event to get application keyboard short cuts in a Delphi program. Using the following code: procedure TForm1.ApplicationEvents1ShortCut(var Msg: TWMKey; var Handled: Boolean) ; begin if (Msg.CharCode = VK_F9) then begin ShowMessage('F9 pressed!') ; Handled := True; end; end; Question: How do I detect when 'ALT C' has been pressed ? 回答1: Like so: procedure TForm1.ApplicationEvents1ShortCut(var Msg: TWMKey; var Handled: Boolean); begin if (Msg.CharCode =

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

时光总嘲笑我的痴心妄想 提交于 2019-12-04 10:50:32
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 ensure that a valid handle exists. So I have two questions. 1: What's the reason why you shouldn't

Tag editor component for Delphi/C++Builder

妖精的绣舞 提交于 2019-12-04 07:48:37
问题 I need a VCL tag editor component for Delphi or C++Builder, similar to what's available for JavaScript: e.g. this one, or this one or StackOverflow's own tags editor. Is there something like this available or do I need to make it from scratch? Some specific things that I need are: Editor should allow either scrolling or become multi-line if more tags are present than the editor's width allows. If multi-line, there should be an option to define some maximum height however, preventing it from

TStringGrid - is there a simple way to get the “current/selected” row?

左心房为你撑大大i 提交于 2019-12-04 02:52:55
问题 I can go the long way round, loop over each row, get a TRect from CellRect(col, row) , then query its State for gdSelected ... But isn't there a quicker way to get the row number of the currently selected row, if any? 回答1: .Row for selected row, .Col for selected column 回答2: Please have a look at TStringGrid.Row . 来源: https://stackoverflow.com/questions/2107683/tstringgrid-is-there-a-simple-way-to-get-the-current-selected-row

Ctrl+Backspace in Delphi Controls

心已入冬 提交于 2019-12-04 02:24:28
the Ctrl+Backspace keyboard shortcut normally deletes the word to the left from the caret. But it does not work in any of the standard Delphi controls you would expect ( TEdit , TMemo , TComboBox ect.). Interestingly, Ctrl+Delete works just fine. Does anybody know how to correct this behaviour easily? I know that overriding the KeyDown procedure would do it, but this is a rather too complicated as KeyDown has to be overridden for every component. This is not a Delphi-specific issue. Indeed, TEdit and the other controls are merely wrappers for the native Microsoft Windows controls, and they

Delphi non visual TTree implementation

雨燕双飞 提交于 2019-12-03 21:37:56
问题 I'm looking for a non visual persistent tree (TStringTree) implementation. If someone known any good implentation of it, please let me know. Thanks. 回答1: You'll find a flexible, non-visual tree structure in the DI Containers library (commercial). However, as others have noted above, it's really quite easy to roll your own, adding only the functionality that you need. You can do with just two base objects: TNode and a TNodeList (e.g. a TObjectList descendant). At minimum, TNode needs just

How do I get the SelectedValue of a ComboBox from code?

故事扮演 提交于 2019-12-03 17:37:00
I am trying to build something like a TLookupComboBox using LiveBindings. I have placed a normal TComboBox on a VCL form. I also have a data set with some rows that have the two fields id and text . Then I used the LiveBindings editor to create a TBindSourceDB and a TBindingsList . There is just one binding in it: object BindingsList1: TBindingsList Methods = <> OutputConverters = <> UseAppManager = True Left = 244 Top = 229 object LinkFillControlToField1: TLinkFillControlToField Category = 'Quick Bindings' Control = ComboBox1 Track = True FillDataSource = BindSourceDB1 FillValueFieldName =

Running VCL in a separate thread

怎甘沉沦 提交于 2019-12-03 17:15:14
I now have a rather rare situation. I have an application which directly interacts with Windows' message queue. This application also runs external Lua scripts with LuaJIT. I wanted to have a debugging facility for these scripts, so I've created a plain VCL application, and then converted it into a DLL library. When the first application starts a debugging session with the library, this DLL creates a separated thread, where the whole VCL facility is initialized and run. procedure TDebuggerThread.Execute; begin Application.Initialize; Application.MainFormOnTaskbar := True; Application

Are there any “mind mapping” components for Delphi? (native VCL preferably) [closed]

邮差的信 提交于 2019-12-03 16:05:44
I'm looking for a pre-written component (w/source) for a Delphi project that I'm working on, to generate mind-maps / concept-maps similar to these: http://en.wikipedia.org/wiki/Image:MindMeister_screenshot_OS_X.jpg http://en.wikipedia.org/wiki/Image:XMIND_2008_in_Windows_Vista.png Any ideas? As a former Delphi developer, I sympathize. It used to be that you could find a free component with source for just about anything. You probably know about the Delphi Super Page (my old go-to source for everything Delphi). I looked; no mind-mapping components, there. (Of course, the site has not been