-
Content Count
1099 -
Joined
-
Last visited
-
Days Won
24
Everything posted by aehimself
-
Executor v2 - Desktop workflow application for Windows
aehimself replied to bresson's topic in I made this
A long time ago I did an SQL script editor with syntax highlight via RichEdit. The reason I eventually changed to SynEdit was the speed... I probably could have optimized the coloring code but why to try to do something, if someone else did it already and better than I ever could / would...? I personally oppose file compression utilities (it already bit me in the bottom) so I suggest you skip that entirely. Storage is cheap, network is fast nowdays. Use SynEdit, zip the dowload file and you are all set :) -
Hello, I am trying to "dim" a whole tabsheet so a notification can be clearly shown - blocking the sheet itself, but not blocking the main form. I guess I'd need an alpha blended panel or a semi-transparent bitmap drawn on a TImage... never really worked with imaging until now so I'm not sure about the terms. Other than the standard components I have Graphics32 installed; can this be achieved with a custom TPanel descendant or with Graphics32 somehow? I would like not to install any 3rd party component just for this if not needed. Worst case scenario I'll capture the tabsheet as a bitmap and draw it on a alClient panel with Canvas.Draw - which supports opacity. Using Delphi 10.4.2 if it matters.
-
In theory it's already done automatically, you don't have to do anything. TDimPanel.Resize is supposed to do just that.
-
The issue is, VisibleChanging is being called BEFORE the new visibility took place. If the panel is currently visible, .VisibleChanging means it's going to be hidden, so it's freeing up the bitmap and the only thing it does is painting the background black. What are you trying to achieve, why are you calling VisibleChanging by hand? It's meant to be automatic, called by the .Visible setter.
-
Hello, I have a pagecontrol with multiple tabs. I would like to make a screenshot (paint the whole control in a TBitmap) for further processing. The currently visible one paints just fine but I have no success of the ones which are not. Either I get an image of the active one, the bitmap is completely white or black. I already tried - PageControl.Pages[a].PaintTo - BitBlt - PrintWindow WinApi I know I can quickly activate each tab and grab a shot of them but I'd like to avoid this "flicker" if I could. I'll keep researching but in the mean time if anyone has an idea of what I can try I would be really thankful :) Cheers!
-
Executor v2 - Desktop workflow application for Windows
aehimself replied to bresson's topic in I made this
One is cluttered, mouse-oriented and hard to read and navigate. The other on the other hand also provides other features like built-in webpage preview, AI integration, basic window management, etc. This doesn't seem to be a fair comparison. -
Executor v2 - Desktop workflow application for Windows
aehimself replied to bresson's topic in I made this
The project looks interesting. Are the installed applications auto-detected or you have to configure them somewhere? You could also add file indexing so entering "readme" would pop up all possible readme files across your local drive. If you make a Linux executable it could be a really good launcher for tiling WMs. Even fits in design :) -
TGridify, convert a flat table into a pivot-grid in one line of code
aehimself replied to david berneda's topic in Delphi Third-Party
You really should treat Julia better :D- 3 replies
-
- pivot-table
- datamining
-
(and 2 more)
Tagged with:
-
Did you use the Delphi IDE to rename or remove the component? For a component to be streamed properly you need 3 things (4 if counting the obvious): - Component descriptor in .pas (MyComponent: TSpinEdit) - Unit in Uses list, before the component (usually Interface) - Component descriptor in .dfm (MyComponent: object/inherited MyComponent: TSpinEdit) These have to exist in your frame and all of it's ancestors. When I had this error, it was usually one of the above.
-
Try to get rid of the "with dm2 do begin". It might not cause the issue but makes codereading and debugging significantly more difficult (debugger evaluator usually goes nuts). I had strange text in DBGrids some time ago, it was caused by memory corruption in the DB access component. Based on what you posted, there's no mentions of the stringgrid so I tend to think your issue might be caused by something like this too.
-
programmatically determine the edition of RAD Studio 12.3
aehimself replied to dmitrybv's topic in Delphi IDE and APIs
As this information might be useful I added TAEIDEVersion.Edition and TAEIDEVersion.ExecutableVersion to my installed version / instance detection component. Tested with TAEDelphiVersion, seems to return correct values. -
@yonojoy Sure, go ahead. You might also want to consider @Renate Schaaf's version, which is an installable component and therefore works at design time as well.
-
Any delphi components for VNC or RemoteDesktop?
aehimself replied to ChrisChuah's topic in General Help
When experimenting with a new component I suggest a "barebone" example first. One control on the form, setting up and connecting in FormCreate. I'm not going to recreate your form layout and filter out the essentials I'm sorry... I already showed how I'm doing it and it works fine. Also keep in mind that by importing the MsTscAx control you are effectively using the current version available in your Windows setup: it can / might / surely will differ between versions, editions and even patch levels. -
Any delphi components for VNC or RemoteDesktop?
aehimself replied to ChrisChuah's topic in General Help
The first window warns about "invalidity" of certificate and approval of access for a specific function (drive mapping maybe?). You will not be able to bypass this (you can ignore the certificate so the warning only comes back once the cert is renewed). The second one you can bypass by specifying the username and password. This is how my tabbed remote access application sets up MsTscAx controls for RDP connections: If Self.Credential <> nil Then Begin If Not Self.Credential.DomainName.IsEmpty Then _rdp.Domain := Self.Credential.DomainName; If Not Self.Credential.UserName.IsEmpty Then _rdp.UserName := Self.Credential.UserName; If Not Self.Credential.Password.IsEmpty Then _rdp.AdvancedSettings7.ClearTextPassword := Self.Credential.Password; End; I suggest you check all the .AdvancedSettingsxxx options. There are plenty of tasty settings there to fulfill your needs. -
TListView & TJvListView - Subitems line in 255 characters
aehimself replied to Gin Beginner's topic in VCL
The caption isn't truncated, only the display is clipped: procedure TForm1.FormCreate(Sender: TObject); Const MYTEXT = '<RHINOSTRING English="Exploding this mesh will create %d individual meshes. This may be more than your system can safely manage using the available memory. You can use Weld to make the mesh explode into fewer pieces, or see Help for more information.\n\nClick OK to proceed with Explode, or Cancel to leave the mesh as is.[[24836]]" Localized="Exploding this mesh will create %d individual meshes. This may be more than your system can safely manage using the available memory. You can use Weld to make the mesh explode into fewer pieces, or see Help for more information.\n\nClick OK to proceed with Explode, or Cancel to leave the mesh as is.[[24836]]" />'; begin ListView1.Items.Add.Caption := MYTEXT; ShowMessage(MYTEXT.Length.ToString + sLineBreak + ListView1.Items[0].Caption.Length.ToString); end; Shows 661 and 661 respectively. The reason seems to be a WinApi limitation: https://stackoverflow.com/questions/19881409/tlistview-add-600-characters-on-item-caption -
Ignoring nil values with ΤJsonSerializer
aehimself replied to pyscripter's topic in RTL and Delphi Object Pascal
Does TJSonSerializer work with TObjectList and TObjectDictionary already? As far as I remember this is why I started to (de)serialize objects manually back around Delphi 10.4 but would love to automate things finally :) -
For a while I used this unit to detect the OS version and edition. For a while it is unmaintained though and could use some refactoring for sure. As @David Heffernan mentioned you must include a mainfest file as a resource in your application, otherwise OS detection will return false information due to compatibility modes.
-
I read a tip here on DelphiPraxis back in 10.x that disabling the Welcome screen altogether greatly improves stability. Since then that's the first thing I do after a Delphi installation and the IDE is rock solid since then. You get an AV if you click on the Welcome screen settings in Options, but that's a sacrifice I'm willing to live with :)
-
I'm using this code for alternating colors: Procedure TDBGrid.DrawColumnCell(Const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); Var dataset: TDataSet; {$IFDEF HIDECOLLINESIFEMPTY} colline: Boolean; {$ENDIF} editcolor: TColor; hidefocus: Boolean; Begin dataset := Self.DataSource.DataSet; // This method is only being called on DATA cells, which only happens if there is a dataset connected. Therefore, no // need to perform an assigned check here. {$IFDEF HIDECOLLINESIFEMPTY} colline := True; {$ENDIF} hidefocus := Not (csDesigning In Self.ComponentState) And (gdSelected In State) And Not Self.Focused; If (dgMultiSelect In Self.Options) And (Self.SelectedRows.CurrentRowSelected) Then Begin End Else If dataset.IsEmpty Then Begin {$IFDEF HIDECOLLINESIFEMPTY} colline := False; {$ENDIF} editcolor := TStyleManager.ActiveStyle.GetStyleColor(scEdit); Self.Canvas.Brush.Color := editcolor; Self.Canvas.Font.Color := editcolor; End Else // This code imitates the highlight of the whole row even if RowSelect is disabled. Note that it needs MultiSelect to be enabled! // If Not (gdSelected In State) And grid.SelectedRows.CurrentRowSelected Then // grid.Canvas.Brush.Color := clHighLight // Else If (dataset.RecNo Mod 2 = 0) And ((State = []) Or hidefocus) Then Self.Canvas.Brush.Color := TStyleManager.ActiveStyle.GetStyleColor(scButtonDisabled) Else If (dataset.RecNo Mod 2 = 1) And hidefocus Then Self.Canvas.Brush.Color := TStyleManager.ActiveStyle.GetStyleColor(scEdit); If hidefocus Then Self.Canvas.Brush.Color := TStyleManager.ActiveStyle.GetStyleColor(scCategoryButtonsGradientBase); {$IFDEF HIDECOLLINESIFEMPTY} If HIDECOLLINESIFEMPTY And colline And Not (dgColLines In Self.Options) Then Self.Options := Self.Options + [dgColLines] Else If HIDECOLLINESIFEMPTY And Not colline And (dgColLines In Self.Options) Then Self.Options := Self.Options - [dgColLines]; {$ENDIF} inherited; Self.DefaultDrawColumnCell(Rect, DataCol, Column, State); End; Supports VCL styles and works fine for a couple of years now. I used the "lazy" technique. Save this as uDBGrid.pas, add is to the uses clause of your form and in the declaration change "grdMyDBGrid: TDBGrid;" to "grdMyDBGrid: uDBGrid.TDBGrid". Since the class name is the same no modification in the dfm is necessary. Drawback is, it only works runtime. And it's hacky.
-
should be simple: is computer on home network?
aehimself replied to bobD's topic in Network, Cloud and Web
I never personally used FireDac, but doesn't it have a configurable timeout property? If no, what you can do is to attempt to connect in a background thread. Use your local connection until DB connection succeeded then simply swap them out and sync changes. -
should be simple: is computer on home network?
aehimself replied to bobD's topic in Network, Cloud and Web
Why to have any additional checks then...? When you initiate a connection to a host name / fqdn, name resolution is done automatically by the DB client library. Just attempt a connection to your database server. If that fails for any reason, fall back to the local DB. -
should be simple: is computer on home network?
aehimself replied to bobD's topic in Network, Cloud and Web
This check will trigger on all networks, which are set to private which is probably not a desired behavior. While these will work, OP's solution will be a different design pattern. What if you put the code in a separate DLL, which you are not distributing; and lives only on your home dev PC? -
should be simple: is computer on home network?
aehimself replied to bobD's topic in Network, Cloud and Web
When you are trying to detect your home network, don't rely on a successful (reverse) DNS lookup. I usually ping my home router (using fqdn) but even better, attempt a connection to a well-known service. However I only use this method to decide if VPN should be fired up or not; it's better to set up your DNS properly so tools will work from inside and outside. If you are keen to go this way I found these two snipplets in my codebase: Function LookupHostName(inIP: String): String; Var host: PHostEnt; addr: Integer; dat: TWSAData; Begin Result := ''; WSAStartup($0101, dat); Try addr := inet_addr(PAnsiChar(AnsiString(inIP))); host := GetHostByAddr(@addr, 4, PF_INET); If host <> nil Then Result := String(host.h_name); Finally WSACleanup; End; End; This one was abandoned halfway as no variables seem to be declared: Write('Attempting to resolve ' + HostName + '...'); If WSAStartup($0101, wsdata) = 0 Then Try tmp := GetHostByName(PAnsiChar(HostName)); If tmp <> nil Then Begin tmpin.sin_addr.S_addr := LongInt(PLongInt(tmp^.h_addr_list^)^); IPAddress := inet_ntoa(tmpin.sin_addr); WriteLn(IPAddress); End; Finally WSACleanup; End; May I ask why your program needs to behave different from a specific network? There might be a better way than relying on simple checks, which might trigger in places you don't want them to. -
The basic ones (label, edit, memo, etc.) are self-explanatory. For the rest I'm usually creating an empty project, dropping one of the components on the form and start experimenting in what I can do with it.
-
Set StyleName for one single control, yet no style for the rest of the app
aehimself replied to CyberPeter's topic in VCL
I had one situation when VCL styles flickered a lot, and that was if they were on an anchored / aligned panel and the form was being resized. Setting .ParentBackround := False on the panel solved this though.