Jump to content

Pat Foley

Members
  • Content Count

    437
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Pat Foley

  1. Pat Foley

    record with null-terminated string

    S:array[0..23] of ansichar THeader = Record flags : integer; dummy : integer; name: S; //padding: integer; end; That may be enough to get you started just determine the array size and the correct encoding. If you wanting to do the easy way use component streaming or simply loadfromfile and value pairs. This example was "streamed" by copying from design and pasted here. You can "stream" it by copying it and pasting in your design. object Memo1: TMemo Left = 56 Top = 40 Width = 185 Height = 89 Lines.Strings = ( 'Flag=true' 'Dummy=" "' 'name=Pete2005' '') TabOrder = 0 end
  2. Is there a Unit1 already present in the source folder, if not in the Project? When creating a new unit, the IDE looks at existing units in the folder and chooses the highest unused sequential number. Or in the Default folders under Tools either shared repository or Default project.
  3. Pat Foley

    GeocodeReverse on Android

    Hey, It must be same issue as before you need to force repaint. The FMX.locationdemo updated location data when I changed from map view back to show location data.
  4. Pat Foley

    GeocodeReverse on Android

    procedure TForm1.LocationSensor1LocationChanged( ... // Translate location to address if Assigned(FGeocoder) and not FGeocoder.Geocoding then FGeocoder.GeocodeReverse(NewLocation); //As described earlier, after Reverse Geocoding is completed, an OnGeocodeReverseEvent is fired. From sample. I will bring out the win 7 machine with the FMX stuff on it but probably two days out. I want to make two FMX programs this year Phone app that caches local data or least miles from North pole and miles West of home when cell towers down or out of range. A program to read topo map from Garmin 600t would nice too.
  5. Pat Foley

    GeocodeReverse on Android

    I just tried the FMX.locationdemo on my android and the current address is working on that demo. So maybe try the location demo and try edit boxes on it to see what that demo does.
  6. Pat Foley

    GeocodeReverse on Android

    Ok from your sample is your likewise event happening and is then using cached data or simply not getting new data since in background. procedure TForm1.LocationSensor1LocationChanged(Sender: TObject; const OldLocation, NewLocation: TLocationCoord2D); var URLString: String; begin // code for previous step goes here // Show Map using Google Maps URLString := Format
  7. Pat Foley

    GeocodeReverse on Android

    On webbrowser side try a reload. Or the equivalence of the F5 key in a webbrowser.
  8. C:\Program Files (x86)\Embarcadero\Studio\20.0\bin what error(s) does clicking on bds.exe show in above directory. I put a bds.exe on win 7 and its error message "xxx.bpl missing...Try reinstalling the program" Walk up the error messages displayed fixing the errors or simply reinstall.
  9. Pat Foley

    Panel invalidate won't refresh information.

    If that's all you need just try show or set focus event to get the windows attention. I think it would work better without the thread your callback event would simply wait its turn behind mouse events.
  10. Pat Foley

    Strange new behavior TDBEdit

    I would put a breakpoint on the helper form.show line. Or simply drag the mainform around to see if the form is lurking behind.
  11. Pat Foley

    SMS via my phone..

    Lifted from How to Send Text From Computer (6 Working Ways) 2019 (techviral.net // In Email account use following for address Now in the field To you will write the mobile_number@carrieraddress according to your carrier addresses given below: -> AT&T: number@txt.att.net -> T-Mobile: number@tmomail.net -> Verizon: number@vtext.com -> Sprint: number@messaging.sprintpcs.com or number@pm.sprint.com -> Virgin Mobile: number@vmobl.com -> Tracfone: number@mmst5.tracfone.com -> Metro PCS: number@mymetropcs.com -> Boost Mobile: number@myboostmobile.com -> Cricket: number@sms.mycricket.com -> Nextel: number@messaging.nextel.com -> Alltel: number@message.alltel.com -> Ptel: number@ptel.com -> Suncom: number@tms.suncom.com -> Qwest: number@qwestmp.com -> U.S. Cellular: number@email.uscc.ne // Note the site has things not to click on but does mention hooking a phone into windows 10 session which I haven't tryed. I know above works well with phonenu@vtext
  12. I think using verbs is better. //old way procedure runTimer(bRuntimer); timer.enabled := bRuntimer; // better two procedures Procedure Run timer.enabled := True; Procedure Stop timer.enabled := False; // later expand the functionality Procedure Step timer.enabled := False timer.timer // to walk through code // // Nick Hodges in his book says always program against an interface. I say always program against a 5 inch X 3 inch UX or 3 X 5 UI. Also consider this for codebase T: Boolean Inside procedure What T := T and B or A Doing this preserves the T incoming state. This latching allows T's state set elsewhere be used reducing the tests in What.
  13. Pat Foley

    Converting C struct to Delphi

    On the Gary Darby site http://delphiforfun.org/Programs/oscilloscope.htm said "I cleaned up a few things ... using Windows wavein API multistep protocol" It is a fantastic straddle.
  14. Pat Foley

    Turn off title on a TImage??

    Too many dog ears dog ears = tabs
  15. Pat Foley

    Turn off title on a TImage??

    Or in Design window the switch is in Options Show components captions
  16. Pat Foley

    Turn off title on a TImage??

    Pretty sure TImage does not have caption prop View the xxx.bmp in Pbrush to if text captured in original image. D10.4.1 Out of text view of .DFM object Image2: TImage Left = 0 Top = 0 Width = 360 Height = 249 Align = alClient Picture.Data = { 07544269746D61704E010100424D4E0101000000000036040000280000006301 0000B6000000010008000000000018FD00000000000000000000000100000000 ...
  17. Pat Foley

    Popup window with focus inside.

    Here's a screen shot of code realized.
  18. Pat Foley

    Popup window with focus inside.

    These forms show using CB items being created once referred then after. Showing the CB dropdown using messages. Using the CB to navigate other forms using only one list. Most of it is done by creating the ancillary form(s) in runtime. unit mainFocused; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Edit1: TEdit; Memo1: TMemo; mainCB: TComboBox; procedure Button1Click(Sender: TObject); procedure FormClick(Sender: TObject); procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure Button2Click(Sender: TObject); procedure Memo1Change(Sender: TObject); procedure Edit1Change(Sender: TObject); procedure FormCreate(Sender: TObject); procedure mainCBChange(Sender: TObject); private { Private declarations } public { Public declarations } formsSL, Headings: Tstrings; destructor Destroy; override; end; var Form1: TForm1; implementation uses formAncillary; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin Headings.text := edit1.Text; UF.IniZ(self, formsSL, Headings); end; procedure TForm1.Button2Click(Sender: TObject); var I,C: integer; F: TForm; Ctrl: Tcontrol; begin with Screen do begin for I := 0 to formCount - 1 do // downto 0 do begin F := Forms[I]; for C := 0 to F.ComponentCount - 1 do if F.Components[C] is TCombobox then begin Ctrl := F.Components[C] as Tcontrol; F.Show; Ctrl.parent.Show; Ctrl.Show; caption := F.Name; sleep(20); Ctrl.Perform(CB_ShowdropDown,1,0); application.ProcessMessages; sleep(1200); Ctrl.Perform(CB_ShowdropDown,0,0); application.ProcessMessages; Break; end; end; Headings.Text := Headings.Text + format(' %d',[I]);//I.ToString; end; end; destructor TForm1.Destroy; var I: integer; begin onclick := nil; with Screen do begin for I := formCount - 1 downto 0 do begin Forms[I].close; end; end; end; procedure TForm1.Edit1Change(Sender: TObject); begin Headings.Text := Edit1.Text; end; procedure TForm1.FormClick(Sender: TObject); begin Caption := 'clicked by ' + (Sender as TForm).Name; Self.Show; Button1.SetFocus; end; procedure TForm1.FormCreate(Sender: TObject); begin Headings := TStringList.Create; formsSL := mainCB.items; //borrowing created list formsSL.Add(self.Name); end; procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin Caption := 'Mouse over ' + (Sender as Tcontrol).Name; end; procedure TForm1.mainCBChange(Sender: TObject); var I: integer; S: String; begin for I := 0 to Screen.FormCount - 1 do begin S := mainCB.Items[mainCB.ItemIndex]; if S <> Screen.Forms[I].name then continue else Screen.Forms[I].show; end; end; procedure TForm1.Memo1Change(Sender: TObject); begin beep; end; end. Runtime created unit formAncillary; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls; type TfrmAncillary = class(TForm) Button1: TButton; Image2: TImage; remoteCB: TComboBox; procedure Button1Click(Sender: TObject); procedure remoteCBChange(Sender: TObject); procedure remoteCBDropDown(Sender: TObject); private { Private declarations } public { Public declarations } myHeadings, myLines: Tstrings; rfrmBoss: TForm; procedure IncomingTextUpdate(Sender: TObject); procedure ForwardFocus(Sender: TObject); procedure IniZ(bossForm: TForm; someLines, Headings: Tstrings); end; var UF : TfrmAncillary; implementation {$R *.dfm} procedure TfrmAncillary.Button1Click(Sender: TObject); begin beep; end; procedure TfrmAncillary.remoteCBChange(Sender: TObject); var I: integer; S: String; begin for I := 0 to Screen.FormCount - 1 do begin S := remoteCB.Items[remoteCB.ItemIndex]; if S <> Screen.Forms[I].name then continue else Screen.Forms[I].show; end; end; procedure TfrmAncillary.remoteCBDropDown(Sender: TObject); begin remoteCB.Items := myLines; remoteCB.Text := myHeadings.Text; end; procedure TfrmAncillary.ForwardFocus(Sender: TObject); begin rfrmBoss.OnClick(self); end; procedure TfrmAncillary.IncomingTextUpdate(Sender: TObject); begin remoteCB.Invalidate; end; procedure TfrmAncillary.IniZ(bossForm: TForm; someLines, Headings: Tstrings); begin Application.CreateForm(TfrmAncillary, UF); with UF do begin mylines := someLines; myHeadings := Headings; remoteCB.Items := someLines; name := 'UF_' + Screen.FormCount.ToString; myLines.Add(name); Caption := name; setbounds(10,20,360,270); rfrmBoss := bossForm; onclick := ForwardFocus; onmousedown := nil; onmouseMove := bossForm.OnMouseMove; Color := RGB(random(255),random(255),random(255)); show; end; end; end.
  19. Pat Foley

    Popup window with focus inside.

    Good points. Where I am the users don't use keyboards or even have them in some rooms. the application writes messages to combo boxes. So over the years forgot some applications would allow user to change information in a combo box.
  20. Pat Foley

    Popup window with focus inside.

    Most users do not know that they can edit in combo box but they do know that they can see old 'text messages' with dropdown. It depends on purpose in application.
  21. Pat Foley

    Popup window with focus inside.

    Sorry viewer = "UI" "UX". Correctly the term should be viewport. Memo1.text := 'Allows this text to be viewed' Since the CB has a text and dropdown we need pass string and strings to keep it updated. The improvement is rather than passing the information each time. We simply update using the references provided in the creation of form. I suspect some programs use timers to provide updates. I will try to improve naming of the examples say 30 hours out.
  22. Pat Foley

    Popup window with focus inside.

    The combo box (CB) should only be used as a viewer. To set up a CB viewer do this This scheme lets simple Tform, TStrings, {String} to allow code reuse. {String} Is commented out untried but someLines will show current memo lines readily. the memo.sel is not needed here. presented simply to provide message flag to find its sisters in the source. in TfrmdrawFocused ... myLines: Tstrings; myCBtext: String; .. procedure TfrmdrawFocused.IniZ(anOwnerForm: TForm;var someLines: Tstrings; {aText: string}); begin Application.CreateForm(TfrmdrawFocused, UF); with UF do begin mylines := someLines; {myCBtext := AText} // remoteCB.Items := someLines; does not work needs freshened {remoterCB.Text := aText} name := 'UF' + Screen.FormCount.ToString; Caption := name; setbounds(10,20,360,270); toFocusAhead := anOwnerForm; onclick := ForwardFocus; onmousedown := nil; onmouseMove := anOwnerform.OnMouseMove; Color := $1E69D2; show; end; end; ple
  23. Pat Foley

    Popup window with focus inside.

    There's a difference between focus and select. To help with combobox these bits should help. the Memo stuff only provides hints of selecting for your combobox //CB Recipe seasoning Procedure TG1.SelectMemoLine(Memo : TCustomMemo) ; Var LineNumber : Integer; Begin LineNumber := Memo.Perform(EM_LINEFROMCHAR, Memo.SelStart, 0); Memo.SelStart := Memo.Perform(EM_LINEINDEX, LineNumber, 0); Memo.SelLength := Length(Memo.Lines[LineNumber]) ; Memo.SetFocus; ... //CB dropdown freshened in the form procedure TfrmdrawFocused.remoteCBDropDown(Sender: TObject); begin remoteCB.Items := myLines; end; ... //CB text freshened with timer or update from mainform remoteCB.Text := referenced editbox.text from other form. remoteCB.Invalidate;
  24. Pat Foley

    Popup window with focus inside.

    Here's a thought--take a screenshot and look for the mouse cursor? In the long past screen captures may had a cursor captured in it. Would cause great confusion with the running cursor. So the big G himself washes the imaged cursor out so you don't have too! Not exactly your question asked but a large part of why focus on active window is best.
  25. Pat Foley

    Popup window with focus inside.

    runtime forms should feed mouseovers and form name back to creator form. Perhaps what you want is a windows balloon tip.
×