vcl

How do i custom draw of TEdit control text?

女生的网名这么多〃 提交于 2019-12-01 06:41:53
I'd like to draw a piece of TEdit.Text using Font.Color different from the default. Are there any examples how to do that? I'm attempting to do something like this: NOTE: what this screenshot pictures is merely a hairy draft, but it convinces me what problem solvable. Edit controls do not have owner-draw support, but you can custom-draw it by sub-classing it and handling WM_PAINT (among many other messages). It's doable, but it would be a world of pain to actually implement 100% correctly. From the docs: Developing Custom Draw Controls in Visual C++ : Note that owner-draw will work for most

How to use threads with idhttp in delphi 10

梦想的初衷 提交于 2019-12-01 01:30:35
i need help to speedup my project,i have 2 ListBoxs, the first is full with URLs, the second i store in it the URLs that causes 404 error from Listbox1, its just checking process. the idhttp takes about 2s to check 1 url, i dont need the html, cause the decryption process takes time, So i decided to add threads in my project, my code so far unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, IdSSLOpenSSL, Vcl.StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP;

Checking two TDateTime variables

こ雲淡風輕ζ 提交于 2019-12-01 01:07:46
I am using C++ Builder and have the following question: I am wanting to detect if a date/time is later than another date/time, and by how much. Here is my current code: TDateTime testFirstDate("11/09/2012"); TDateTime testFirstTime("14:00"); TDateTime testSecondDate("12/09/2012"); TDateTime testSecondTime("16:00"); TDateTime testCombined1 = testFirstDate + testFirstTime; TDateTime testCombined2 = testSecondDate + testSecondTime; TDateTime testDateDifference = testSecondDate - testFirstDate; std::cout << testDateDifference; In the above example, the following gets printed out: 31/12/1899 The

Delphi non visual TTree implementation

醉酒当歌 提交于 2019-11-30 23:32:38
I'm looking for a non visual persistent tree (TStringTree) implementation. If someone known any good implentation of it, please let me know. Thanks. 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 three members: your string data, a reference to its parent node (nil if the node is root), and a TNodeList,

Checking two TDateTime variables

微笑、不失礼 提交于 2019-11-30 21:12:05
问题 I am using C++ Builder and have the following question: I am wanting to detect if a date/time is later than another date/time, and by how much. Here is my current code: TDateTime testFirstDate("11/09/2012"); TDateTime testFirstTime("14:00"); TDateTime testSecondDate("12/09/2012"); TDateTime testSecondTime("16:00"); TDateTime testCombined1 = testFirstDate + testFirstTime; TDateTime testCombined2 = testSecondDate + testSecondTime; TDateTime testDateDifference = testSecondDate - testFirstDate;

How to use threads with idhttp in delphi 10

折月煮酒 提交于 2019-11-30 20:51:47
问题 i need help to speedup my project,i have 2 ListBoxs, the first is full with URLs, the second i store in it the URLs that causes 404 error from Listbox1, its just checking process. the idhttp takes about 2s to check 1 url, i dont need the html, cause the decryption process takes time, So i decided to add threads in my project, my code so far unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl

vcl.h: No such file or directory

蹲街弑〆低调 提交于 2019-11-30 20:41:30
问题 I'm looking to compile some old source code in Visual C++. However, the first of many errors I am receiving is: vcl.h: No such file or directory This appears to be in reference to the Visual Component Library, native to Borland compilers it seems. I downloaded the free Borland C++ 5.5 command line compiler, but it doesn't seem to contain a vlc.h in its include directory. How can I resolve my issue? Many thanks. 回答1: This old code must have come from C++Builder. If it actually uses the VCL,

how to sort in Tlistview based on subitem[x]

℡╲_俬逩灬. 提交于 2019-11-30 19:19:33
How to sort in tlistview with data present in subitem[x] ? Set SortType := stData and write procedure TForm1.ListView1Compare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer); begin Compare := StrToInt(Item1.SubItems[x]) - StrToInt(Item2.SubItems[x]) end; for instance. If compare is negative, Item1 should come before Item2; if compare is positive, the opposite applies. Thus this example, which assumes that SubItem[x] contains an integer, will sort the items according to the numerical value of SubItem[x]. If, on the other hand, SubItem[x] contains strings, then you

How to make a Delphi TSpeedButton stay pressed if it's the only one in the group

强颜欢笑 提交于 2019-11-30 18:15:50
I'm not sure why the TSpeedButton has this property but when a TSpeedButton is the only button of a given groupindex, it doesn't stay pressed, whether or not "AllowAllUp" is pressed. Maybe a Jedi control would suffice, but hopefully there's some fix. Any help or anecdotes are appreciated. BTW, I'm (still) using Delphi 7, not sure if this is an across the board conundrum. I have no D7 here, but in D2006 a Speedbutton stays down if the GroupIndex has a value > 0. If this is not the behaviour you wish, you can set the Down-Property manually in the OnClick-Eventhandler (make sure, that the

How add Delphi XE2 64bit support to a simple Delphi XE2 32bit VCL component?

瘦欲@ 提交于 2019-11-30 17:31:06
I need convert a VCL component from 32bit to 64bit (Delphi XE2). Now infact I can install it only if I select "32bit Platform", if I select "64bit Platform" I can compile it but not install (there is not the install menu). How can I add 64bit support and install it for 64bit application? If you mean "install it into the IDE", the simple answer is that you cannot. The IDE is a 32-bit application and is not designed to host 64-bit DLL's. Any components or plug-ins must be compiled for 32-bit in order to work with the IDE itself. 64-bit support in a component is for runtime support only, not