Jump to content

PeterBelow

Members
  • Content Count

    447
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by PeterBelow

  1. Relocate the actual work to a secondary thread. At the start of the thread's Execute method use TThread.Queue to pass a method to the main thread that creates the progress dialog. The dialog is not shown immediately, though, it just starts a timer with the delay you want. If the timer fires before the thread has completed its work, show the dialog. The dialog can the either use a timer to check for the thread's progress at intervals to update its display, or the thread can inform the dialog through Synchronized method calls of its progress. When done it can then tell the dialog to close itself, also through a Synchronized method call.
  2. PeterBelow

    Rad Studoi 11.2 Installation

    Download the web installer from https://my.embarcadero.com. It will uninstall your existing 11.1 and then install 11.2, using the existing licence key. Remove GetIt installed IDE add-ins (like Parnassus Bookmarks) before you start the update and reinstall them from GetIt afterwards.
  3. PeterBelow

    Best place for Spring4D questions

    This forum has a 3rd-party section that may do: https://en.delphipraxis.net/forum/13-delphi-third-party/
  4. PeterBelow

    Replace TCheckBox with TDBCheckBox

    You have to change the type both in the form pas and dfm files.
  5. https://my.embarcadero.com/#downloadsPage works normally for me. (Win10, Firefox as browser). I did not try to download anything, though.
  6. PeterBelow

    Close App on PC Shutdown??

    On normal shutdown running apps get a WM_QUERYENDSESSION message, followed eventually by WM_ENDSESSION. The VCL handles WM_QUERYENDSESSION by firing the main form's OnCloseQuery event but OnClose or OnDestroy may not fire on system shutdown. So OnCloseQuery is the best place for detecting app closing.
  7. PeterBelow

    Problem with Gauge component.

    TGauge is a really ancient sample component (from D1 days I think). Have you looked at TProgressbar as alternative?
  8. PeterBelow

    HoursBetween

    With the 24 hour clock 00:00 is interpreted as midnight starting the current day and 24:00 as midnight ending the day.
  9. PeterBelow

    HoursBetween

    That's just like HoursBetween works, the return value is an integer, so the difference is rounded to the next full hour. Use MinutesBetween and divide the result by 60 if you want the difference to be in fractional hours.
  10. You need to find the database component used for the connection to the database. It may reside in a data module autocreated at program start, so start by opening the dpr file (project -> view source) and check the first Application.CreateForm statements. Open the datamodules one by one and look for a component with "connection" in its type. For FireDAC that would be a TFDConnection component, which has a LoginPrompt property, which is probably set to true in your case. You can set it to false and specify user and password in the Params property to avoid the dialog. Details depend on the database access framework your app uses.
  11. This is a Delphi form using TBitBtns, so it has to come from somewhere inside your application. But it may come from some library you use, e.g. a database login build into the data access framework the app uses.
  12. PeterBelow

    Can't make a popup form go behind the main form in z-order

    In Delphi the main form (the one created first by an Application.CreateForm statement in the DPR file) is the API owner of all forms created later, so it is lower in the Z-order. It is also the only form having a taskbar button. Lazarus seems to behave like old Delphi versions (before Windows Vista), where the zero-size Application window was the API owner of all forms and owned the taskbar button. This made all forms siblings in the Z order and allowed any form to be covered by the main form. You can get this behaviour back in Delphi by setting Application.MainformOnTaskbar := false; in the DPR file, but that is not recommended since it does not work well with the taskbar in modern Windows versions. If you really need to you can uncouple a form from the main form in Z-order by overriding its CreateParams method. // in form declaration Procedure CreateParams( Var params: TCreateParams ); override; Procedure TFormX.CreateParams( Var params: TCreateParams ); begin inherited CreateParams( params ); params.wndParent := 0; //or Application.Handle // the following gives the form its own taskbar button params.ExStyle := params.ExStyle or WS_EX_APPWINDOW; end;
  13. PeterBelow

    The Delphi 11.2 release thread

    Basically legalese I think. They guarantee it will run on the platform mentioned but you can probably run on older platforms, but on your own risk.
  14. PeterBelow

    Disable fade effects

    Weird, I just tried with a simple VCL test project on my system and do not see any fade effect when changing the item index on a combobox having the focus, neither with csDropdown nor with csDropdownlist style. Tried with both D11.1 and 10.4. Win10 basically with default display options, main monitor, scaling 100%.
  15. PeterBelow

    Disable fade effects

    VCL or FMX? Windows 10 or 11? Standard Windows style or some other style?
  16. PeterBelow

    Data Binding retreiving data from list

    If you use the LoadMovie function in the code unit generated by the wizard you get an IXMLMovieType interface back. Its Uniqueid property returns an interface of type IXMLUniqueidTypeList, which derives from IXMLNodeCollection, so it represents a list of nodes (represented by IXMLUniqueidType interfaces), accessed via the Items property. The list interface inherits a Count property from IXMLNodeCollection, so you can write a classical for loop to iterate over the Items property to examine each of the UniqueId nodes, to find the one with the Type_ property you are looking for (note the underscore added to the property name by the wizard, to avoid a collision with the reserved word type).
  17. Have you tried to use the correct UTF16 code points instead, e.g. #$2012 etc.? Check the proper codes to use in the Windows Charmap application.
  18. https://docwiki.embarcadero.com/Libraries/Alexandria/en/Vcl.ComCtrls.TRichEdit https://docwiki.embarcadero.com/RADStudio/Alexandria/en/What's_New#TRichEdit_Component_updated_to_RichEdit_4.1_.28MSFTEDIT.dll.29 There are new events, e.g. OnLinkClick and extensions to the TTextAttribute type used by SelAttributes.
  19. Oh come on, it's not that bad. There are even instructions on how to manually clean up after an uninstall in several blog posts on the emba site, e. g. https://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwi8r9iV0un5AhVC7rsIHTWvAQ0QFnoECAQQAw&url=https%3A%2F%2Fblogs.embarcadero.com%2Fmanual-uninstall-of-rad-studio-delphi-c-builder-10-2%2F&usg=AOvVaw0wqOftotNG03B76ft4LoXa
  20. PeterBelow

    How can I move a window to the left edge of a monitor?

    Couldn't you just set the ScreenSnap property to true to allow the user to snap the form to a screen edge?
  21. Are you setting up SelAttributes correctly before assigning text to SelText? D11.1 uses a newer version of the rich edit common control (4.x), which has more capabilities than the old 2.x version used by prior Delphi versions.
  22. PeterBelow

    need help to change the hex in binary file

    Looks like an attempt to hack a program to get around a security feature; you will get no help here for such (likely illegal) activity. It won't work anyway, if you modify a signed executable it will no longer match the signature and the OS will not load it.
  23. PeterBelow

    Form closing - curiosity question..

    Well, closing the main form ends up calling Application.Terminate, which results in a WM_QUIT message posted to the message loop. The reaction to that is to set Application.Terminated to true and fall out of the message loop in Application.Run. After that the Application object proceeds to free all forms and datamodules it ownes in the inverse order of creation. Things are unfortunately not always so clear, though. If a modal form is open it uses its own message loop, which also ends and causes ShowModal to return as if the user cancelled the dialog. Code in the calling method will execute after that until the code flow returns to the main message loop. A further complication are unowned forms. They will get destroyed after the owned forms when the main form window handle is destroyed, as far as I remember, by Windows, since the main form is the API-level owner of all secondary forms. Unowned Forms disconnected from the main form by overriding CreateParams will die last (unless explicitely closed in code executed when another form is destroyed), when the process dies. This usually does not give the form any chance to clean up after itself. So, if you need to have all forms die in an orderly manner you are best served by iterating over Screen.Forms and close each form found explicitely, with the main form last.
  24. PeterBelow

    Save Timage picture as png

    Whether this works or not depends on the source image format. TPngImage does not support direct assignment from a TJpegImage, for example. In such a case you have to go through a TBitmap as intermediate. procedure TForm1.Button1Click(Sender: TObject); var png: TPngImage; bmp: TBitmap; begin image1.Picture.LoadFromFile('C:\Users\Peter_2\Pictures\7.5. Stadtführung.jpg'); bmp:= TBitmap.Create; try bmp.Assign(Image1.Picture.Graphic); png:= TPngImage.Create; try png.Assign(bmp); png.SaveToFile('C:\Users\Peter_2\Pictures\test.png'); bmp.SaveToFile('C:\Users\Peter_2\Pictures\test.bmp'); finally png.Free; end; finally bmp.Free; end; ShowMessage('Done'); end;
  25. PeterBelow

    comma separated values in DBEdit

    Not with a TDBEdit. Databound controls are typically linked to one single record (the current record in the dataset); using them the typical workflow is: add new record - enter data for this record - post the record to the dataset. You have to use an unbound TEdit in your case and dissect its content in code, e.g. when the user leaves the control (OnExit event), or when he pushes a button. Pseudo code: var LList: TStringlist; N, LValue: integer; begin LList := TStringlist.Create; try LList.StrictDelimiter := True; LList.Commatext := Edit1.Text; for N:= 0 to LLIst.Count - 1 do begin if TryStrToInt(Trim(LList[N]), LValue) then begin add record to dataset store LValue into the dataset field post the record end; {if} end; {for} finally LList.Free; end; end;
×