delphi

Overload DateTimePicker draw button to create a themed component

We have bought the TMS Component pack dto do a "facelift" on our apps. I am trying to create a descendant of TAdvDateTimePicker to get its border and buttons draw according to what I want. The border no problem - I made it for an TAdvEdit descendant and for the TAdvDateTimePicker was no problem (with the border). But the buttons, what p...

TPanel color is black no matter what

Hi. I just activated the themes in my Windows XP (usually I work using the classic Win9x look) and I have seen that two panels are pure black. Other panels are ok (color = clBtnFace). What these 2 panels have in common is their parent. Both are placed directly on a TForm. If I move them to a different parent (another panel for example) t...

TPanel color is black when I drop a XPManifest control on my form

This is a continuation of a previous post: TPanel color is black no matter what The problem is this: All TPanels that have a TForm as parent, turn black when I use a XPManifest. Anybody knows why? ...

What is the difference between compiling and building in Delphi?

With Delphi-6 there are two options: Build and Compile. I know when I run a program it compiles only the files which have changed and uses the DCUs for those which haven't. When I click build apparently it rebuilds the DCUs. What I have been wondering is, when I make a program for release (changing build settings, conditional variable...

How do I keep my coordinates within the bounds of the Screen?

This is my code... curX and curY are my current X and Y coordinates while tmpX and tmpY are relative X and Y values (how much the mouse has moved). curX:= curX+tmpX; curY:= curY+tmpY; I use these values to move/control my cursor-shaped form. How can I keep the cursors within the screen? I tried limiting the values until Screen.Heigh...

What should I use to programmatically generate printout/report i Delphi

I need to generate a report/printout programmatically. My app currently uses FastReport to build a report, consisting of text, images, tables etc. It does not bind to any database. Everything is built programmatically. However, the finished report does not look the same in PDF and RTF, and the old code is generally very complicated. ...

How to create a kiosk-like UI, so that the user can never exit from it or switch to another application?

I need to create a simple Delphi application, kiosk style. It is a very simple thing, a single form where the user writes some personal info to register to an event. 4 TEdit and a TButton. What I want to achieve is to avoid the user does any action different then typing in TEdit or clicking on the TButton. For example I don't want he d...

Delphi TStringList wrapper to implement on-the-fly compression

I have an application for storing many strings in a TStringList. The strings will be largely similar to one another and it occurs to me that one could compress them on the fly - i.e. store a given string in terms of a mixture of unique text fragments plus references to previously stored fragments. StringLists such as lists of fully-qua...

Why context_info can fail?

I am using context_info to simulate a global variable, I use it in this context. I have scripts made up of several batches, I set a global variable at the beginning (123 in the example) and then after all the batches I use that number to populate a log table. Now this works, but today it failed on one machine, I cannot figure why. Is t...

how to write a generic script without explicitly writing the database name when it is a mandatory parameter

I need to run a script like EXEC sp_dbcmptlevel AdventureWorks, 100; GO Now I'd like to have a generic version that uses the database I am connected to, is it possible in T-SQL? Something like this, but this doesn't work: EXEC sp_dbcmptlevel DBNAME(), 100; GO It doesn't work of course because a string is returned, I'd like to have...

How best to add Load / Save file to/from a version control system to my Delphi Application

I have an Application that is based on loaded test programs, saved as text-based files in a specific user data folder. All fine. A client has just commented that they would like to have full traceability of changes to such test programs (for ISO9001 etc) and it occured to me that I could provide some kind of checkout / commit mechanism a...

delphi and the displaying of a listbox items

I'm using a listbox to display a simple list of filenames. I also have an edit component that allows me to search those items via a simple: procedure TForm1.Edit1Change(Sender: TObject); const indexStart = -1; var search : array[0..256] of Char; begin if edit1.Text='' then exit; StrPCopy(search, Edit1.Text) ; ListBox1.ItemInde...

Best way to swap two records in TDataset Delphi?

New to delphi and database programming in general but am curious if there is a better way to swap records in a TDataset? I have read through some help and cant find any obvious methods. Currently I have a procedure implemented to move records down the dataset until they hit the Eof marker. However I am getting some odd errors when I get ...

Any Games Engine for Delphi?

I want to create a game in Delphi Is there any good game engine for Delphi? based on directx 10 or OpenGL? I need it for 3D games, or only I can do that with C++? ...

Delphi - TPaintBox - Resize

Hello everybody, I'm having problems resizing a TPaintBox and drawing on it: On my Form (named FMain) I dropped a TPaintBox (named DisplayImage), which I am trying to resize as the Form is resized. To do that I wrote an OnResize() method for FMain (I confirmed that it's being called correctly) in which I try to resize the DisplayImage...

Getting started with ExtPascal: some minimalistic tutorials or code examples needed

Tonight I tried to attempt an ExtPascal application. I am using Delphi 2009. I followed all the steps in the Getting Started section and after some fights I was able to type http://localhost/cgi-bin/ExtPascalSamples/ in the browser and see (almost) this effect (almost, last 3 panels had some display problems, the Show source code bu...

Delphi TPageControl not responding to clicks on tabs

I have an app with a TPageControl on the main form. The pagecontrol has several tabs. The app can be minimized to a tray icon. Sometimes after running minimized for a while, when I restore the main window (via a right-mouse click on the tray icon), the tab that was last displayed is displayed, but I can't select any other tabs! If I ...

How can get my form to be on top of everything all the time?

I have these little cursor shaped forms that I need to be on Top of everything, all the time... FormStyle is already fsStayOnTop I use this code: SetWindowPos(tempCursor.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE ); and this (even though I don't exactly know what it does): procedure TCursorFrm.Creat...

Where should I put my utility methods? How can I used my customized form? (Delphi)

I've been using Delphi for a little over a month, but I still do not know the proper way of doing things. If I have methods which I can use on a lot of projects should I put them on a Unit, Form or DataModule? I have not used a unit (in itself), New-> Unit. Should I put my utility methods there? If so, is there an example I can look at,...

type of expression must be boolean

i got an error message type of expression my be boolean..how i want to solve this problem function GetModeratedFormName(sSourceModuleName: String) : TForm; begin if AdditionalModerator(sSourceModuleName) then exit; if sSourceModuleName = 'frmCI' then RESULT := frmCI; end; ...