MarkShark
Members-
Content Count
88 -
Joined
-
Last visited
Everything posted by MarkShark
-
@Anders Melander Are your SaveDC and RestoreDC calls from a class helper for TCanvas? I don't do a lot of canvas drawing and only recently need to use the API functions for this and I don't fully understand when calling Canvas.Refresh is needed... and I'm wondering if your calls handle that. Thanks!
-
I have a background worker that I create with: FWorker := Parallel.BackgroundWorker .NumTasks(1) .Execute(HandleQueryWorkItem); I queue jobs to this worker and everything works great . I have a situation where I want to check if the worker is idle with a timeout, so I'm trying to use: FWorker.WaitFor(MyMilliseconds); This seems to work in my test cases, however calling WaitFor calls "CompleteAdding" (which seems to make sense.) However it never gets turned back on and future queueing of jobs raises "Adding to completed collection". So is there a way to turn queueing back on, or am I doing something fundamentally wrong? Thanks for any insight or tips! -Mark
-
Windows file explorer in detail view shows combobox-like headers (on hover over) that allow filtering the data based on the column type (for example to only show files changed today, or to only show Excel documents.) Does anyone know if this is something that the standard TListView control is capable of directly, or is this more an owner draw header type thing? Alternately, is there a similar control that can do this? The TVirtualStringTree in column mode perhaps? My searches on this haven't panned out so I'm wondering if anyone has any suggestions or thoughts. Thanks! -Mark
-
The specific case is that I'm using a TComboBox as an editor in a VirtualStringTree. Unfortunately I can't seem to capture VK_TAB on the KeyDown event of the control. I've used code very similar to the "Properties" tree demo included in the Advanced Demo. Running that demo I get the same affect, pressing Tab while a combobox is active goes to the next focus control. I'd like to handle it much like the enter key and move to the next cell after accepting the edit. Apparently the tab handling is happening at the form level and the TCombobox never seems to get it. Any suggestions on how to handle this? Thanks!
-
Thank you François! I ended up creating my own TEmbeddedComboBox and used the handling suggested in Remy's answer to your linked SO question.. and SCORE! procedure TEmbeddedComboBox.WndProc(var Msg: TMessage); begin inherited; if Msg.Msg = WM_GETDLGCODE then Msg.Result := Msg.Result or DLGC_WANTTAB; end;
-
Lars, thanks. This is code I'm writing for a VirtualStringTree that allows editing. I'm sure you're correct that the actions could be handled at the form level, but obviously I'd prefer to keep the handling internal to the control if possible. I was hoping this was just something I'm thinking incorrectly about, maybe there's another way to handle it. Although the fact that the VST demo app shows the same behavior makes me think it's not an easy fix. I did some code searching and it looks like Delphi's TInplaceEditList (part of the Grids Unit) is what they use instead of just using a TComboBox, I assume that's to give more control and to handle this issue. It's a bit complex for a transplant, so I'm hoping someone can suggest an alternative. It's one of those things where it seems like I'm so close to getting it to work the way I want.
-
I've attached ProjTest.dproj. I took the following steps: Created a new Vcl project. Added Target Platform Win64 Used the Project Options Dialog to add version info to "All Configurations - All Platforms" setting version 1.2.3.4 (and also editing the key/values) Used the Project Options Dialog to add version info to "All Configurations - Windows 32-bit Platform" setting version 5.6.7.8 (and also editing the key/values) Used the Project Options Dialog to add version info to "All Configurations - Windows 64-bit Platform" setting version 9.10.11.12 (and also editing the key/values) Also added some debug and release version info for each target. Save on Project Options Save Project Result: The debug and release verinfo sections were correctly removed. The Base, Base-Win32 and Base-Win64 sections remain intact (I'm still unsure if that's "as intended" or not.) ProjTest.dproj [added: I'm using Delphi 10.4.1 and the latest Project Magician.]
- 13 replies
-
- project magician
- line breaks
-
(and 1 more)
Tagged with:
-
Yes, though I'll make a new test case and retest my findings just in case it's project specific (this particular project is one that's been around for years.) Thanks for clarifying about when Project Magician does its work!
- 13 replies
-
- project magician
- line breaks
-
(and 1 more)
Tagged with:
-
My projects platforms are Win32 and Win64. Am I correct that the Magician actions take place on Project Save? Basically I'm just switching Targets, changing the version info, then saving the project and then looking at the dproj file to see the results. [added] In my testing with a project that has Win32 and Win64 target platforms only, that Base_Win32 and Base_Win64 retain <verinfo_*> changes when saving the project.
- 13 replies
-
- project magician
- line breaks
-
(and 1 more)
Tagged with:
-
I've been doing some testing of the current version and I might be misunderstanding things. I have a dproj file with a Base config with verinfo information (including <VerInfo_Keys> info.) I added a new one under Base-Win32 and both seem to stay around. I was expecting the win32 one to be removed in favor of Base. Am I misunderstanding how it works? It did correctly remove the verinfo stuff from a debug section. Is this so that you can have different version info for different target platforms? Project Magician is awesome btw!
- 13 replies
-
- project magician
- line breaks
-
(and 1 more)
Tagged with:
-
My goto has been Consolas, but this change seems a good one! I'll have to look into those fonts. BTW, having recently started to use Delphi Styles I'd love to see SynEdit support them. Fortunately I get around it by adding: TCustomStyleEngine.RegisterStyleHook(TCustomSynEdit, TMemoStyleHook); // to get styled scrollbars And then either changing the all the colors whenever the style changes OR by using the Vcl.Styles.Hooks unit. I usually go with the hooks since I use a couple other controls that don't support styles fully (like spTbxDock and spTbxToolbar, which I've noticed you're doing some much needed work on!) Fantastic work!
-
@pyscripter Thank you for that, it's extremely useful! I'd like to add that Microsoft has changed their encoding standards in the new NotePad. I mention this because our current Delphi TEncoding names are from the original standard. The new standard is: ANSI UTF-16LE UTF-16BE UTF-8 UTF-8 with BOM Which seems an improvement over just using "Unicode" for UTF-16LE. Also saves default to UTF-8 (without BOM) instead of ANSI, for good or bad (I *think* good, but I bet there are other opinions!)
-
@Darian Miller Thank you for posting that. I forgot to do that when I moved to 10.4 and have been meaning to look it up.
-
Sync Prototypes - syncronize parameters! :)
MarkShark replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Yes, whichever one you currently have the caret on (or at least that's how I use it.) I don't think I've seen a problem related to it yet (though I've had it just not work at all, but that was due to my own syntax error.) -
Nice find! This is actually pretty useful and seems to work well on my projects so far. I wonder if this is "official" (the latest documentation for "XML Documentation Comments" doesn't mention it.)
-
Sync Prototypes - syncronize parameters! :)
MarkShark replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
This was a very nice addition. I use it often and it seems to work pretty well. -
Hey All! I use the wonderful VCL-Style-Utils (https://github.com/RRUZ/vcl-styles-utils) I especially use the Vcl.Styles.Hooks option since I have a number of older vcl controls that aren't style friendly and this gets them working well enough. However, I do sometimes want to not style the common dialogs windows. One valid reason is that the font selection dialog box has issues with styles and scrolling the font list, but it's also that I worry that the styling might interfere with a necessary part of my program (I don't mind that they don't look styled, I kind of consider them as separate from my program.) When using the standard VCL Styles you can do this using: TStyleManager.SystemHooks := TStyleManager.SystemHooks - [shDialogs]; But I haven't found a way to do it using Vcl Style Utils, so I was wondering if anyone's done it or if I'm missing something obvious. Or, as I believe is likely, you can't use the hooks option and hope to shutoff "part" of the styling. Thanks for any input!
-
Native Svg parsing and painting in Windows
MarkShark replied to pyscripter's topic in RTL and Delphi Object Pascal
I've tried the two commercial ones (SVG Magic and Delphi SVG.) They both had issues with my homemade Inkscape svgs, however that was last year (2019) and they may have improved. I have tried SVGIconImagelist recently and it does have the issues I mentioned (reported in their issue tracker on Github.) I'm not sure if that's improved recently. That one does look the most promosing! The other two open source ones I tried were both older and not actively developed that I could see. -
Native Svg parsing and painting in Windows
MarkShark replied to pyscripter's topic in RTL and Delphi Object Pascal
That's extremely cool! This appears to load some of my svg's that several of the open source Delphi svg projects had issues with (mostly with object positions being offset in strange ways.) On some of my svgs I had converted text to paths, which displays nicely (of the course the text ones do not as you mentioned.) -
Although I avoid using Goto (and usually With as well) in my own code. I appreciate the library writers who do whatever they can for performance or usability! I think I still use the "super pos" function that was written for the old fastcode challege which has a bunch of gotos and is amazingly fast.
- 7 replies
-
- optimization
- bug
-
(and 1 more)
Tagged with:
-
Why should I use good source control versioning system?
MarkShark replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
TortoiseHg has a nice interface. When I needed Git last month I installed TortoiseGit but found it didn't seem to have the same type of user interface (I'm no version control expert, so I appreciate a gui for it.) I then tried SourceTree and it seems like a good solution to work with both. -
No kidding Dave! When I got to that line of code and realized it's been in there for a while I was quite surprised. Now granted, I would like the safety version, but this works for now!
-
Stefan, thanks for that suggestion! I looked into removing the constraint and found that TOmniValue already has an alternate method called TOmniValue.FromRecordUnsafe that completely solves my issue. nice!
-
Thank you Stefan! On the OmniThreadLibrary I switched from passing records to passing Objects instead. Seems an easy-ish fix, but, of course, now I have to manage those object's lifetimes. No biggie.
-
So much for hopeful thinking on my part! First couple of projects compiled without issues, then I tried one with the TOmniThreadLibrary and boom. I use TOmniValue.FromRecord() with a record with strings in it, which I believe is the issue here. Anyone know a workaround for that? I have to admit that its worked so well up til now that I haven't looked back at that code in while.