delphi-2007

IDE: Structure viewer displays all items expanded

大城市里の小女人 提交于 2019-12-10 19:10:50
问题 Delphi 2007: Whenever I switch to a new pas file the structure viewer displays its class entries in an expanded form. This is very annoying! Is there a way that the classes items are always displayed in a compressed tree view. Chris 回答1: Right click on the "Structure" pane and select "Properties" from the context menu. In the "Explorer Options" dialog, you'll see a "Explorer categories" check list box. For each item in this box, there's a tiny figure (a tree) between the check box and the

Delphi: How can I check if any mouse buttons are pressed - OUTSIDE of a mouse event?

眉间皱痕 提交于 2019-12-10 17:05:15
问题 I have a TDrawGrid and want to handle clicking on a cell and scrolling through cells with the mouse wheel slightly differently: When scrolling with the mouse wheel, the view shall center on the selected cell, when simply clicking on a cell, the view shall not move (because that'd be confusing). Scrolling with the mouse wheel fires the OnSelectCell event. Clicking on a cell FIRST fires OnSelectCell , followed by OnMouseDown . So I need to figure out if OnSelectCell was triggered by a mouse

Delphi 2007: GlobalMemoryStatus to get total RAM

女生的网名这么多〃 提交于 2019-12-10 15:39:43
问题 I need to get the total physical memory of a system using Delphi 2007. Using GlobalMemoryStatus on a system with 4GB or greater seems to give me errors. In Delphi 2007 GlobalMemoryStatusEx does not exist so I added the function call to my program manually. It returns the memory on my Windows 7 x64 correctly (8GB) but on a Vista x32 system it still returns an incorrect value (should be 4GB on this system but returns 2.9GB). Any Idea what I may be doing wrong? And will the GlobalMemoryStatusEx

Optimize included files and uses in Delphi

妖精的绣舞 提交于 2019-12-10 15:16:43
问题 I try to increase performance of Delphi 2007 and Codeinsight. In the application there are 483 files added in the DPR file. I don't know if it is imagination but I feel that I got better performance from Codeinsight by simply readd all files in the DPR. I also think (correct me if I'm wrong) that all files that are included in a uses section also should be included in the DPR file for best performance. My question is, does it exists a tool that scan the whole project and give a list what

How to make a separate unit for event methods, which IDE allows me to assign to component events at design time?

前提是你 提交于 2019-12-10 14:38:37
问题 I'm having a form with certain components whose are having event handlers. Now I would like to move those event handlers (those methods) to a separate unit still being able to assign them to component events through the Object Inspector at design time. Is it possible to make a separate unit only for event methods, so that the Object Inspector allows me to assign them at design time ? Let's say if I would make that unit with a public procedure: unit Unit2; interface procedure ButtonClick

When should I add a file reference to a Delphi project?

℡╲_俬逩灬. 提交于 2019-12-10 13:34:13
问题 Unit files for standard VCL files like Dialogs, StringUtils etc is never referenced in a projects DPR-file. But when should I add a reference to the DPR-file ? Now I have own sourcefiles and source of own components. What about source files for Ravereport, Devexpress, Indy, Gnostice etc ? I want as fast codeinsight as possible, but of course I do not want to add bloat to the DPR-file. I use Delphi 2007 See also this question for a related issue. Regards 回答1: I always add all my own code units

Is there a ComboBox that has Items like a TcxRadioGroup?

末鹿安然 提交于 2019-12-10 11:54:45
问题 The TcxRadioGroup component of DevExpress has a very nice way to specify items. You can specify a Caption and a Value (and a Tag) for each TcxRadioGroupItem. The TcxComboBox and the normal TComboBox of Delphi on the other hand use TStrings to store its items. While TStrings can have a Name and an Object, there is no easy way to hook up a name and a value using the form designer of the Delphi IDE. Is there a ComboBox control (preferably from DevExpress) that allows to visually design its items

Better multi-threaded debugging in the Delphi

半世苍凉 提交于 2019-12-10 09:24:12
问题 Leading on from the answer to another question about bugs in the Delphi IDE, does anyone know if there is a way to improve the multi-threaded debugging functionality of the IDE, or if not, at least why it is so bad on occasion? When you have multiple threads within a program, stepping through the code with F7 or F8 can often lead to either very long pauses, or the whole IDE just locks ups. This is especially apparent when you leave or enter a method or procedure. The debugger always seems to

How can I clean the Parameters field in the Run -> Parameters menu?

萝らか妹 提交于 2019-12-10 03:12:20
问题 I'm using the CodeGear RAD Studio IDE. In order to test my application with command line parameters I used a few times the "Parameters" field in the "Run -> Parameters" menu. But every time I provide it with a new value, it could not be deleted from the "dropdown box". I need to clean this field (erase all the values), since in some cases there is information on them that I don't want to share with people that occasionally could use my machine. How can I clean this field? 回答1: The Delphi 2007

In Delphi, how can you check if an IInterface reference implements a derived but not explicitly-supported interface?

我们两清 提交于 2019-12-10 01:27:03
问题 If I have the following interfaces and a class that implements them - IBase = Interface ['{82F1F81A-A408-448B-A194-DCED9A7E4FF7}'] End; IDerived = Interface(IBase) ['{A0313EBE-C50D-4857-B324-8C0670C8252A}'] End; TImplementation = Class(TInterfacedObject, IDerived) End; The following code prints 'Bad!' - Procedure Test; Var A : IDerived; Begin A := TImplementation.Create As IDerived; If Supports (A, IBase) Then WriteLn ('Good!') Else WriteLn ('Bad!'); End; This is a little annoying but