

PeterBelow
Members-
Content Count
563 -
Joined
-
Last visited
-
Days Won
13
Everything posted by PeterBelow
-
Is there a keystroke that re invokes Delphi keymapping versus add on?
PeterBelow replied to rudy999's topic in Delphi IDE and APIs
If you run into this problem and then call up the Tools -> Options dialog, what does it show as active key mapping on the Editor -> Key mapping page? -
If you put a breakpoint on the first GetDeviceCaps line, do you reach it when running under the debugger? If so, does Printer.Handle have a reasonable value? Are you dealing with a network printer here that may be offline? So many questions, so little data...
-
Type inference in assignment but not comparison??
PeterBelow replied to PiedSoftware's topic in RTL and Delphi Object Pascal
But you can state it explicitely, just use an appropriate type cast, e.q. Smallint(1) instead of just 1. -
Enum modules return ONLY the application, no other packages
PeterBelow replied to alogrep's topic in VCL
Have you enabled "Build with run-time packages" in the project options? If not all code from the units in question will be compiled into a monolithic exe and there will be no other modules other than DLLs used from the OS or statically linked by units used in the application. -
You need file system level authentification to access files on the LAN via file system API functions, see WNetAddConnection3 if this is for Windows. For web folders you have to use something like ftp if the server supports it.
-
TDBGrid does not support that. If you have fields with long text a grid is not the best way to show it, better use a TDBMemo in addition to the grid and tie it to the field in question. It will them show the field content of the record active in the grid as the user scrolls through the records.
-
How do I create/generate unique ID texts?
PeterBelow replied to JohnLM's topic in Algorithms, Data Structures and Class Design
Look at the System.Hash unit, this kind of problem is usually the domain of hashing. -
Yes, apart from the licence restriction re yearly revenue.
-
Take a look at TVirtualImagelist and TVirtualimageCollection, these allow you to supply different versions (sizes) of bitmaps optimized for the DPI settings your app may encounter in the wild. This tends to look better than getting the images scaled at runtime from a single sized version.
-
You do not have the source (pas) for the unit and you should never set up a project to have the source files for Delphi RTL etc. units on its search path. You should have the precompiled FireDAC.Phys.SQLiteWrapper.dcu, though, and the path to its folder should be on the IDE library path for the target platform in question.
-
You need a 64-bit obj file for that. Is this for a C++-Builder or a Delphi project?
-
I you are running the IDE on a monitor with scaling set to anything other than 100% it matters if you have enabled high DPI support for the form designer or not (the latter is equivalent to launching the IDE via the Delphi (DPI unware) shortcut the installer provides in the start menu group. You can find the relevant setting in the Tools -> Options dialog:
-
Can you not just ditch it and use TEdgeBrowser supplied with Delphi instead?
-
The Delphi program folder contains a console program named tdump.exe (and tdump64.exe for 64 bit executables) that you can use to examine the segments of the C DLL. Look for the exports table and check whether there is an entry for this params variable. If there is you can load the DLL from Delphi (LoadLibrary) and retrieve the address of this export via GetProcAddress, like for an exported function. Store the returned address into a variable of a suitably defined pointer type and you can access the value of the variable.
-
Perhaps you can use the Screen.OnActiveFormChange event for this. But keep in mind that it is not only called when a new form is shown but also when focus changes between forms. It may also happen too late for your purpose.
-
Good to know one can learn something new even at my age :)...
-
If you want to be able to edit this new property in the IDE Object Inspector I don't see a way to do this since it would require not only a change of the source code of the TComponent class but also a rebuild of all design and run-time packages that use TComponent, and you do not have the source code for all of them, as far as I know. If using this property in code would be enough there may be a way to fake it using a class helper for TComponent that uses the existing Tag property to store an index of the actual string held in some global container, like a TStringlist.
-
Depends on how you store the loaded names. If these are records from a database, for instance, and you access them via a query or table component each result row will have its own memory, regardless of what it contains. With a query you have the option of removing duplicates in the SQL statement used, but only if the row does not have any other columns with non-duplicate content. If you load the names into a TStringlist you can set the list's Duplicates property to dupIgnore, it will then discard values already in the list when you try to add them.
-
You have to use OnKeyPress and check for Ctrl down there. The behaviour you see is perfectly OK, by the way. Ctrl-<letter> combos have created control characters since the ancient days of DOS, and ^I (#9) is the TAB character...
-
The debugger will show exceptions before they are trapped in try except blocks in the code. The dialog you got allows you to tell it to not show this particular exception type in the future. To re-enable it you have to go into the IDE options dialog (Tools -> Options). Under the "Debugger" node you find (under "Embarcadero Debuggers") two lists with the exception classes to ignore. Just uncheck the one you blocked. Note that the dialog may look a little different if you use a Delphi version older than 12.
-
No, since it is not a user-triggered change from the combobox's view.
-
Auto-Fontsize , Colwidths, RowHeights at Grid / TMS TAdvstringgrid
PeterBelow replied to o815's topic in VCL
You would have to draw cell content yourself (OnDrawCell event) to achieve that, but in my opinion such behaviour is a horrible idea in the first place. It would give a very uneven grid appearance and you will also have the problem that larger font sizes than the grid default will also require a bigger row hight to avoid text cut off at the bottom. Either adjust the column width or (more difficult) implement word wrap for cells with longer text. That also requires drawing the cell yourself and adjusting the row hight, which is tricky since it will trigger a redraw of the row and thus fire OnDrawCell again. An alternative is to use the grid with reasonable default font size and column autofit and place a panel or frame with individual edit and memo fields below it. Clicking on a grid row shows the content of the row in the individual controls of the panel, the content of which the user can scroll if required. -
The "buttons" in such a group are of class TGrpButtonItem and that class does not seem to offer a way to adjust the alignment. But the TButtonGroup itself has a number of events you can handle to draw the buttons yourself, like OnDrawButton. Better study the source to see how the buttons are drawn by default to see how you can modify that.
-
When will we have a 64-bit IDE version ?
PeterBelow replied to luciano_f's topic in Delphi IDE and APIs
The IDE is 32 bits. The 64 bit compiler is a separate executable, which is why it can only be used if you compile via MSBuild. It is intended for use on build servers as I understand it, not while you're working in the IDE. -
Well, what do you want to achieve here? Look at the source code for TControl, from which TPanel inherits the Caption property and its SetText and GetText accessor methods. procedure TControl.SetTextBuf(Buffer: PChar); begin Perform(WM_SETTEXT, 0, Buffer); Perform(CM_TEXTCHANGED, 0, 0); end; Setting a control's Caption or Text properties ends up sending messages to the control. WM_SETTEXT stores the passed string and CM_TEXTCHANGED is a notification for the control that the caption or content has changed, which typically makes the control redraw itself. TCustomPanel, the immediate ancestor of TPanel, has a private message handler procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; that just calls Invalidate to redraw the panel. If you want to react to a change of the panel Caption you have to add a handler for this message to your modified TPanel class. You cannot override the parent method since it is not virtual or dynamic and also private. But you can call the inherited message handler inside your handler using the inherited keyword. If you just want a panel that does not show the Caption: it has a ShowCaption property that you can set to false to achieve that. You could set that in an overridden Loaded method.