delphi-2010

How to discard mouse click in TDbGrid.OnColumnMoved

感情迁移 提交于 2019-12-01 16:14:03
问题 In a TDbGrid.OnColumnMoved event handler, I adjust some column headings colors. I also use the grid's OnTitleClicked event to pop-up a (sort column) menu. Unfortunately, after the user drags a column and OnColumnMoved is finished, the VCL calls OnTitleClicked . This means my sort-order pop-up appears after column dragging. Is there a way in OnColumnMoved I can clear the mouse event queue so that OnTitleClicked doesn't get called? This thread has this code, but I don't have a Msg in

simple text file encryption based on a key

让人想犯罪 __ 提交于 2019-12-01 15:27:38
问题 I am trying to implement a simple text file encryption technique and I am using the following code to do so. The code is not written by me, I just googled and got it. The encryption technique seems to be pretty simple, concise and easy to implement. I see that it has only one function that can do the encryption and the decryption on the fly. Just pass the key it will do the trick. However, I just wanted to know, is it possible for me to check if the key is passed by the user is correct or not

Inserting dates using “A Simple Delphi Wrapper for SQLite3”

别来无恙 提交于 2019-12-01 10:59:53
I am using delphi 2010, and Tim Anderson's SQLite3 wrapper - http://www.itwriting.com/blog/?page_id=659 - but I am having trouble inserting dates Here is my database creation DB.ExecSql('CREATE TABLE Tags (No Integer NOT NULL, Title VarChar(25) NOT NULL, Creator VarChar(25) NULL, Born Date NULL, Charter Boolean Default False NULL, Owned Boolean Default False NULL, Image Blob NULL, CONSTRAINT PK_No PRIMARY KEY (No));'); Which builds and works fine. I tested it with SQLite administrator - http://sqliteadmin.orbmu2k.de/ I am even able to manually enter dates using adminstrator here is my insert

Delphi 2010: No thread vs threads

杀马特。学长 韩版系。学妹 提交于 2019-12-01 10:46:46
I'm user of delphi 2010, my current machine is intel core i7, running windows 7 x64. I've write the following codes: type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private FCount: Integer; FTickCount: Cardinal; procedure DoTest; procedure OnTerminate(Sender: TObject); end; TMyThread = class(TThread) private FMethod: TProc; protected procedure Execute; override; public constructor Create(const aCreateSuspended: Boolean; const aMethod: TProc); end; var Form1: TForm1; implementation {$R

Binding a second instance of a form to a second instance of a data module?

与世无争的帅哥 提交于 2019-12-01 09:39:20
I have a Form which has data aware controls bound to datasets in a datamodule. I need to create additional instances of both the form and datamodule in the same application. I deleted the global variable that was automatically created when the data module was first added to the project. To my delight, controls in the designer could still be bound to datasets in the data module without this global variable. I'm assuming the IDE is parsing the dfm of the datamodule so the designer can still "see" the datamodule. (without the data module loaded in the IDE the list of data sources is empty) When I

Inserting dates using “A Simple Delphi Wrapper for SQLite3”

随声附和 提交于 2019-12-01 09:28:51
问题 I am using delphi 2010, and Tim Anderson's SQLite3 wrapper - http://www.itwriting.com/blog/?page_id=659 - but I am having trouble inserting dates Here is my database creation DB.ExecSql('CREATE TABLE Tags (No Integer NOT NULL, Title VarChar(25) NOT NULL, Creator VarChar(25) NULL, Born Date NULL, Charter Boolean Default False NULL, Owned Boolean Default False NULL, Image Blob NULL, CONSTRAINT PK_No PRIMARY KEY (No));'); Which builds and works fine. I tested it with SQLite administrator - http:

How to manage circular references in delphi units?

孤人 提交于 2019-12-01 08:33:13
I am using the BeforSignup in the AfterSignup unit in order to be able to call the email variable from within AfterSignup code, finally i enbcountred a problem because i want to make a button which opens the AfterSignup window using the code : AfterSignup.Show; But the problem is that i am obliged to add the AfterSignup unit to the uses list of BeforeSignup and that is exactly what i can't do because i am alreadey using BeforeSignup to AfterSignup unit. i receive an error saying, a reference of circular unit. The easy solution would be to add unitA in the uses clause of the interface section

How to manage circular references in delphi units?

情到浓时终转凉″ 提交于 2019-12-01 06:04:45
问题 I am using the BeforSignup in the AfterSignup unit in order to be able to call the email variable from within AfterSignup code, finally i enbcountred a problem because i want to make a button which opens the AfterSignup window using the code : AfterSignup.Show; But the problem is that i am obliged to add the AfterSignup unit to the uses list of BeforeSignup and that is exactly what i can't do because i am alreadey using BeforeSignup to AfterSignup unit. i receive an error saying, a reference

Delphi 2010 - Source files randomly become read-only in editor?

微笑、不失礼 提交于 2019-12-01 05:13:40
Does anyone else have this problem or is my Delphi cursed somehow? I'll have a bunch of forms and files open in tabs in the editor and I'll be typing away and then suddenly everything stops - my .pas file has, seemingly at random, become read-only. Sometimes I can just right-click the tab at the top and uncheck "Read-Only" and continue, but sometimes this option is checked and greyed-out (disabled), meaning I can't uncheck it and I can't make any further edits to the file. This too seems to be random. In the latter case, the only solution is to save the file in question, which works, despite

Why Delphi says 'cannot resolve unit name xxx'?

荒凉一梦 提交于 2019-12-01 03:11:20
I'm working with Delphi2010 Enterprise Update 4. When I'm opening my project in the IDE and displaying the mainform code, there are 2 unit names underline in red . xxx http://img268.imageshack.us/img268/6475/unitnameunresolved.png . I have verified that the path to the unit source is in the Library path and in the Browsing path . Surprisingly, when I'm doing a right-clicking on the unit and selecting Open file at cursor , it works (ie. delphi opens the right unit). Any idea about that ? Error Insight which keeps all the error messages into the structure view is quite buggy. It doesn't