Jump to content

Search the Community

Showing results for tags 'windows'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
  • Delphi General Discussions
    • Tips / Blogs / Tutorials / Videos
    • Delphi Third-Party
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Found 8 results

  1. Tntman

    Animating TListViewItem

    Hello members! I started learning delphi few months ago and recently i discovered that we can make really beautiful user interfaces with delphi FMX styles. I saw on the internet this animation demo ( This is just a design ) and I wanted to implement it in delphi: https://thumbs.gfycat.com/ShamelessConfusedAmbushbug-mobile.mp4 I was thinking to use ListView component in FMX for this with ItemApperance -> DynamicApperance. Everything was cool but i faced one problem. Problem is that I am not sure that TlistViewItem can perform animation when it is been added to the ListView. From my understandings i can only animate "Text1" and other items if i add them -> https://i.imgur.com/Y3SWIsT.jpg There is no option ( or I dont know how to find it ) To animate whole TListItemView when is added to a ListView. **WORKAROUND THAT I HAVE ON MY MIND** I was thinking to drop a ListBox and to add on it "TListBoxItem", after that i would right click it and Go on edit custom style, and try to make it look as i want. I tested this tutorial for editing the look of "TListBoxItem" and it is working nicely: https://www.experts-exchange.com/articles/10054/Implementing-a-ListView-in-Firemonkey.html For animation i planned to use this resources ( not tested, i dont know if it will work ) : So what is my question actually, well i would like to achieve similar design and effect from gif that i showed to you. I would like to use ListView with DynamicApperance. I would like to someone confirm me if that is possible and to give me some references or resource material where i could read more about it.. Also if there is someone who would like to give me a code example i would appreciate a lot. From my tests that i performed ( loop 1000 times, and add 1000 items on ListView and ListBox ) I can say that ListBox performed a lot slower so I would prefer ListView for this, also i think that using ListView here is better practice since ListView is more suitable for this situation based on this post: http://www.delphigroups.info/2/8f/544471.html At the end I just want to point out that im using FMX ONLY because i found it easier to make styles, this program is for Windows only platform. I am using Delphi Rio community ( Free version ). I would also like to add that option " Pull to refresh " that you see on that gif is not needed. Thank you for your answers and help! 🙂
  2. In my Service I want to to receive notification when the system is suspended or resumed (Hibernate/Sleep) so that I can Close Active Sockets connections. Similar questions have got the answer 'the service must use a HandlerEx() callback via RegisterServiceCtrlHandlerEx()' but I have not been able to use it in Delphi. Need more assistance please.
  3. So I have this application, that runs smoothly on a standard PC, and does quite well on a tablet too. With one exception, the virtual keyboard causes quite the headache. Not only does Windows seem to have two different virtual keyboards, they behave quite differently too: First there is the keyboard that has to be actively opened by the user by clicking on the symbol in the tray area. This works fine, but has the disadvantage of "an additional click". (Image 1) Then there is a keyboard (image 2) that can be opened automatically when FMX.Types.VKAutoShowMode := TVKAutoShowMode.Always; is set. According to the fine manual this will cause the virtual keyboard to show even if there is a physical keyboard present. So as soon as the focus is set on an editable component like TEdit, this keyboard will popup and as soon as said component looses focus the keyboard will disappear. Now here's the tricky part: This keyboard looks different, and on some machines (HP tablets with an i5) takes ages (at least 30 seconds) to "pop up". On my VM that I'm running on a Mac with an i7, this happens instantly. Any user who knows iOS will consider option 1 to be "out of the question" so I use option 2, but for the life of me am not able to speed up the virtual keyboard popup process. This might just become a deal breaker, hence this post. TL;DR: Does anyone here have experience with virtual keyboards on Windows tablets, and knows how to open them up quickly on slower systems? Thanks, Sherlock
  4. There are 50 new cross platform samples for Delphi 10.3 Rio FireMonkey available over on Github. The demos heavily feature … http://www.fmxexpress.com/50-cross-platform-samples-for-android-ios-osx-windows-linux-and-html5-in-delphi/
  5. Hi, I have isolated another odd behaviour, and I am just dumping it here, to get it off my mind, and for your entertainment, of course. FMX only. Windows only. Edge case. Reproducible. With TMainMenu that wraps! (There are painting problems when ClientHeight is around Screen.WorkingAreaHeight and the number of menu rows changes because of changed ClientWidth.) unit FrmMain; interface (* The goal: - Maximize ClientHeight, but keep in control of aspect ratio of ClientArea. - Height should be Screen.WorkAreaHeight. - Width should be either Portrait (smaller, 800) or Landscape (larger, 1000). - Need to set Width/Height or ClientWidth/ClientHeight in code. - Prefer to set ClientWidth/ClientHeight over Width/Height. The plot thickens: - Have big TMainMenu component. - In Portrait MainMenu will wrap into two lines! - In Landscape MainMenu will fit on one line! The Problem: - ClientArea painting problem when MainMenu wraps/unwraps, when you toggle between Landscape and Portrait: Odd: - MainMenu.Height is not a property. - Changing MainMenu-Height seems to be part of the problem. - Missing space to grow the window is another part of the problem? Usage: Press buttons in order given below... Problem cases: a) Reset, Portrait, Landscape: - Black (unpainted) area at the bottom edge. b) Reset, Button2, Button1: - Black unpainted area at bottom edge of ClientArea in Window. - Button1 and Button2 not painted correctly, around bottom edge. c) Reset, Lanscape, Button1, Landscape: - Window too big, bottom edge behind task bar. These cases work as expected: d) Reset, Portrait e) Reset, Landscape f) Reset, Button 1 (like Portrait but via using Height property) g) Reset, Button 2 (like Lanscape but via using Height property) Steps: - In new, empty FMX project - rename Form to FormMain - paste test code - connect FormCreate, FormDestroy, FormKeyUp - run - hit keys instead of clicking buttons. *) uses System.SysUtils, System.Types, System.UITypes, System.UIConsts, System.Classes, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Controls.Presentation, FMX.StdCtrls, FMX.Menus, FMX.Layouts, FMX.Objects; type TFormMain = class(TForm) procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); procedure LandscapeBtnClick(Sender: TObject); procedure PortraitBtnClick(Sender: TObject); procedure ResetBtnClick(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private ML: TStringList; fa: Integer; MaxClientHeight: Integer; MaxClientHeight1: Integer; MaxClientHeight2: Integer; MenuHeight1: Integer; MenuHeight2: Integer; procedure InitMemoText; procedure InitMenu; procedure UpdateReport; function AddMenu(M: TMainMenu; Caption: string): TMenuItem; procedure InitItem(I: TMenuItem; fa: Integer); public MainMenu: TMainMenu; MemoText: TText; // ResetBtn: TButton; // PortraitBtn: TButton; // LandscapeBtn: TButton; // Button1: TButton; // Button2: TButton; end; var FormMain: TFormMain; implementation {$R *.fmx} procedure TFormMain.FormCreate(Sender: TObject); begin ML := TStringList.Create; { record this while there is no MainMenu } MaxClientHeight := Screen.WorkAreaHeight - (Height - ClientHeight); InitMemoText; InitMenu; { by now we 'know' the height of the main-menu-lines } MaxClientHeight1 := MaxClientHeight - MenuHeight1; MaxClientHeight2 := MaxClientHeight - MenuHeight2; UpdateReport; end; procedure TFormMain.FormDestroy(Sender: TObject); begin ML.Free; end; procedure TFormMain.FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); begin if KeyChar = 'a' then begin ResetBtnClick(nil); PortraitBtnClick(nil); LandscapeBtnClick(nil); end else if KeyChar = 'b' then begin ResetBtnClick(nil); Button2Click(nil); Button1Click(nil); end else if KeyChar = 'c' then begin ResetBtnClick(nil); LandscapeBtnClick(nil); Button1Click(nil); LandscapeBtnClick(nil); end else if KeyChar = 'd' then begin ResetBtnClick(nil); PortraitBtnClick(nil); end else if KeyChar = 'e' then begin ResetBtnClick(nil); LandscapeBtnClick(nil); end else if KeyChar = 'f' then begin ResetBtnClick(nil); Button1Click(nil); end else if KeyChar = 'g' then begin ResetBtnClick(nil); Button2Click(nil); end else if KeyChar = 'l' then begin LandscapeBtnClick(nil); end else if KeyChar = 'p' then begin PortraitBtnClick(nil); end else if KeyChar = 'r' then begin ResetBtnClick(nil); end else if KeyChar = '1' then begin Button1Click(nil); end else if KeyChar = '2' then begin Button2Click(nil); end end; procedure TFormMain.ResetBtnClick(Sender: TObject); begin ClientWidth := 800; ClientHeight := 600; Top := 100; UpdateReport; end; procedure TFormMain.LandscapeBtnClick(Sender: TObject); begin ClientWidth := 1000; ClientHeight := MaxClientHeight1; Top := 0; UpdateReport; end; procedure TFormMain.PortraitBtnClick(Sender: TObject); begin ClientWidth := 800; ClientHeight := MaxClientHeight2; Top := 0; UpdateReport; end; procedure TFormMain.Button1Click(Sender: TObject); begin ClientWidth := 800; Height := Screen.WorkAreaHeight; Top := 0; UpdateReport; end; procedure TFormMain.Button2Click(Sender: TObject); begin ClientWidth := 1000; Height := Screen.WorkAreaHeight; Top := 0; UpdateReport; end; procedure TFormMain.UpdateReport; begin ML.Clear; ML.Add('Button KeyChars:'); ML.Add(' r = Reset'); ML.Add(' p = Portrait'); ML.Add(' l = Landscape'); ML.Add(' 1 = Button 1'); ML.Add(' 2 = Button 2'); ML.Add(''); ML.Add('KeyChars for Test Cases:'); ML.Add(' a, b, c = Bad'); ML.Add(' d, e, f, g = Good'); ML.Add(''); ML.Add('Info:'); ML.Add(Format(' Screen.Height = %d', [Screen.Height])); ML.Add(Format(' WorkAreaHeight = %d', [Screen.WorkAreaHeight])); ML.Add(Format(' MenuHeight1 = %d', [MenuHeight1])); ML.Add(Format(' MenuHeight2 = %d', [MenuHeight2])); ML.Add(Format(' W-H = (%d, %d)', [Width, Height])); ML.Add(Format(' Client-W-H = (%d, %d)', [ClientWidth, ClientHeight])); MemoText.Text := ML.Text; end; procedure TFormMain.InitMemoText; begin MemoText := TText.Create(self); MemoText.Parent := self; MemoText.Position.X := 10.0; MemoText.Position.Y := 20.0; MemoText.TextSettings.WordWrap := False; MemoText.AutoSize := True; MemoText.Font.Family := 'Consolas'; MemoText.Font.Size := 14; MemoText.TextSettings.FontColor := claBlue; MemoText.TextSettings.HorzAlign := TTextAlign.Leading; MemoText.TextSettings.VertAlign := TTextAlign.Leading; end; procedure TFormMain.InitMenu; var i: Integer; ch1, ch2: Integer; begin MainMenu := TMainMenu.Create(self); MainMenu.Parent := self; ch1 := ClientHeight; for i in [1..8] do AddMenu(MainMenu,'Menu' + IntToStr(i)); ch2 := ClientHeight; MenuHeight1 := ch1 - ch2; for i in [9..16] do AddMenu(MainMenu,'Menu' + IntToStr(i)); ch2 := ClientHeight; MenuHeight2 := ch1 - ch2; end; function TFormMain.AddMenu(M: TMainMenu; Caption: string): TMenuItem; var j: Integer; begin result := TMenuItem.Create(M); result.Text := Caption; M.AddObject(result); for j in [1..2] do begin Inc(fa); InitItem(result, fa); end; end; procedure TFormMain.InitItem(I: TMenuItem; fa: Integer); var t: TMenuItem; begin t := TMenuItem.Create(I); t.Width := 50; t.Height := 50; t.Opacity := 1.0; t.Font.Size := 24; t.Text := 'Item' + IntToStr(fa); t.Enabled := True; t.Visible := True; t.Tag := Ord(fa); I.AddObject(t); end; end.
  6. Development

    sspi error with TWSocket

    Hi, I upgrade the ICS Overbyte version I used to be able to use this Library with RAD Studio 10.2 Tokyo (C++ Builder). I already have a version on a separare computer that works with Rad Studio XE5. Since I add a TWSocket component on a form, I can't compile the project anymore. I have an error : You must define one of SECURITY_WIN32, SECURITY_KERNEL or SECURITY_MAC from sspi.h file. I Added #define SECURITY_WIN32 at the beginning of my project by the problem is not solved. Can you help me ? Best regards,
  7. Hello, i did not find much information about this function but i would like to use it (or does delphi bring own dialog with that ability?) Here is wrapper i use: uses ShlObj; ... function PickIconDialog( IconHandle: HWND; var Filename: string; var IconIndex: Integer ): Boolean; var tmp : String; idx: Integer; begin Result := False; tmp := Filename; idx := IconIndex; if ( PickIconDlg( IconHandle, PWideChar( tmp ), 1023, idx ) <> 0 ) then begin Filename := String( tmp ); IconIndex := idx; Result := True; end; end; This is how i call it: procedure TfrmMain.btnGetIconClick(Sender: TObject); var IconFile: String; IconIndex: LongInt; begin IconFile := ''; IconIndex := 0; try IconIndex := StrToInt( edIconIndex.Text ); except IconIndex := 0; end; if ( PickIconDialog( Handle, IconFile, IconIndex ) = True ) then begin edIconLocation.Text := IconFile; try edIconIndex.Text := IntToStr( IconIndex ); except edIconIndex.Text := '0'; end; Image1.Picture.Icon.Handle := ExtractIcon( hInstance, PWideChar( IconFile ), Cardinal( IconIndex ) ); end; end; What happen is, i get correct Icon displayed but... Iconfilename often is invisible. Other edit fields are invisible overwritten with Value of Iconfilename, Most of time, every field that has no value on start will be invisible overwritten. (ATM i do by workaround, i fill every field before operation with any data) Do i use it wrong? Does better ways exists to have such dialog?
  8. Gnostice Document Studio Delphi version 2018 R2 Build 18.2.2831 released with C++Builder support, new SKUs and more. Highlights in this release: - Marketing name changed to Gnostice Document Studio Delphi. This has no impact on code. - SKUs have been reorganized to cater to popular demands. SKUs based on popular demand. - Essential [$250], Professional [$450], and Ultimate [$600] are the new SKUs. - Essential edition replaces ReportExport edition. Customers of ReportExport edition with an active subscription get a free upgrade to Essential. - Ultimate edition includes all features of Professional + 1 full license of Gnostice StarDocs Document Server Viewer edition. - Support for C++Builder. - PDF rendering enhancements and much more. For the full release notes, please have a look at the following page: https://bit.ly/2vRt2sq To know more about Gnostice Document Studio Delphi, please browse to:https://bit.ly/2nKIeDl https://bit.ly/2nKIeDl To download the trial version, please browse to: https://bit.ly/2zz06Xn Please mail us at support@gnostice.com, if you have any questions. Thank you, The Gnostice DevTools Team https://www.gnostice.com #PDF #Delphi #FireMonkey #DocumentStudio #Windows #macOS #iOS #Android