delphi

Delphi 2010: anyone got the right settings for the formatter not to fold anonymous methods?

With the default settings, the Delphi 2010 code formatter folds anonymous methods on one line. Is there anyone who has found settings to circumvent this? Original code: procedure TUnit.AppendFinalization(const StringBuilder: TStringBuilder); begin AppendMemberResults(StringBuilder, function(Member: TGeneratableInUnit): IStringLi...

Connecting to Firebird embedded on D2010

I downloaded the Firebird DBX driver from http://sites.google.com/site/dbxfirebird/ and I've been able to compile the "Test Connection" project and get it to run. I pointed it to my test DB like so: procedure TMainForm.Button1Click(Sender: TObject); var C: TSQLConnection; begin C := TSQLConnection.Create(Self); try C.DriverName...

How to get/set desktop icons position and size from Delphi?

I like to use large icons on my desktop, but very often they back to normal size, still can't trace why :). As a programmer I decide to write my own utility for saving and restoring icons positions. Googling around doesn't give much info. Can anyone give me a hint or point to link where I could start? ...

How to enable cookies for a pseudo-browser in Delphi?

I was testing an app from Marco Cantu's Delphi 2009 Handbook. This app, called AnonAjax (page 200), has some interesting features to recognize certain elements from a Web page and list them. This app uses anonymous methods with an internal Indy HTTP client component used to access to a given URL. As part of this app's functionality, it l...

How can a Delphi Program send an Email with Attachments via the DEFAULT E-mail Client?

Within my program, I am composing an email to send using the default e-mail client software installed on a user's machine. I have composed the mailto address, the subject, the multilined body, and I have several attachments to be included. I almost got this working using mailto and ShellExecute as follows: Message := 'mailto:someon...

Free Component which can show richtext with pictures Delphi

I need a free component like RichEdit, but which can also show pictures inside. I am using Delphi 7. Unfortunately RichEdit cannot show pictures, and few components which can are not free. ...

How to show a semi-transparent dimmed panel/image in Delphi?

I wish to get a TPanel or TImage to show a dimmed background (with a veil), anyone knows how to accomplish this in Delphi (2010)? I would prefer not to use a component if possible, just raw code. The idea is that when showing a new form the parent one visually shows the user it's "disabled". Something like this: ...

How to programmically find the difference between two directories

First off; I am not necessarily looking for Delphi code, spit it out any way you want. I've been searching around (especially here) and found a bit about people looking for ways to compare to directories (inclusive subdirs) though they were using byte-by-byte methods. Second off, I am not looking for a difftool, I am "just" looking for ...

Is there a way to keep a button from drawing an outline when selected?

I built a custom control, and with theme support on it looks very strange. Is there any way to make it so that it will always draw with themes off, even if the application is built with theme support on? EDIT: I found a way to turn theming off and it didn't help much. The problem is that it's a special button descended from TBitBtn, ...

Creating TWebBrowser in Runtime with Delphi

Hi dudes, I have a TWebBrowser object which is created in runtime and used in background, that is, not visible. The problem is that events like OnDocumentComplete dont work or are not triggered in Delphi2009. Any advice? procedure TfrmMain.FormCreate(Sender: TObject); begin FWebBrowser:= TWebBrowser.Create(Self); FWebBrowser.Regist...

Separate Subversion branches per programming language?

In some projects, I have to deal with more than one programming language (for example a Delphi GUI application which communicates with an C# or Java app). The Subversion repository currently contains three top branches, one per language. Should I change this and group all parts of the project in the trunk like in the following example ...

Strange EListError occurance (when accessing variable-defined index)

Hi, I have a TList which stores some objects. Now I have a function which does some operations on that list: function SomeFunct(const AIndex: integer): IInterface begin if (AIndex > -1) and (AIndex < fMgr.Windows.Count ) then begin if (fMgr.Windows[AIndex] <> nil) then begin if not Supports(TForm(fMgr.Windows[AIndex...

Right to left TRibbon

How can I have the pages in TRibbon right aligned? bidiModeRightToLeft has no effect ...

Build C/C++ library to link it into delphi application... How?

Hi, if I have a source of library written in C/C++ (lets say its libxml2), now I'd like to build it, and link it into the delphi application... I know it is possible, since Delphi Zlib does it ( http://www.dellapasqua.com/delphizlib/ ) ... But my question is, how to prepare those .obj files? Thanks in advance m. ...

Linking C .obj files into Delphi application, resolving standard C dependencies.

Hi, I compiled libxml2 with BCC 5.5 command line compiler, now I have lots of .obj files which I'd like to link into my Delphi application. Unfortunately, I get lots of "Unsatisfied forward or external declaration" errors, pointing to standard C library functions like memcpy, open, recv etc ... What should I do to compile it correctly?...

why memo.loadFromFile takes so long time?

Hi, I use TMemo to display long strings. I was very surprised that method : Memo1.loadfromfile('mem.txt') [mem.txt = 111 kB] took about 35 seconds, what is really really long time. How can I make TMemo load strings in real time? thanx ...

Populate a TTreeView With Directory Tree And Filtering

On a Lazarus 0.9.28.2 project I have a TTreeView, with the name DirTree on my Form(frmConvert), but I want to populate it with all the directory tree, since C:\. Like this: And when the user select the directory, in the second TTreeView, with the name FileTree, appear all the files in that directory, but filtered to show only PDFs. A...

Getting size of a webpage with TWebBrowser in Delphi

Hi dudes, How can I get the size (chars or Bytes) of a webpage loaded using TWebBrowser? I mean "size" as length of HTML content of a webpage loaded. Thanks in advance. ...

Output Of a Process

I'm developing a program using Lazarus, that execute gcc: var AProcess: TProcess; begin if SaveDialog1.Execute then AProcess := TProcess.Create(nil); AProcess.CommandLine := 'gcc.exe ' + SaveDialog1.FileName + ' -o ' TextField23.Text; AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes]; AProcess.Execute; AProcess.Free; en...

Delphi trace tool

I was wondering if there's a tool or a component for Delphi that can trace method execution line by line and create a log file. With this kind of tool it is easy to compare how method performs on two sets of input data by comparing two log files. EDIT: Let's say there is a function 10: function MyFunction(aInput: Integer): Integer; 1...