Jump to content

Vandrovnik

Members
  • Content Count

    523
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Vandrovnik

  1. Vandrovnik

    Getting/Restoring Column Width in TStringGrid with FMX

    Hello, when I want to change column width of the tStringGrid, I use: grZbozi.Columns[a].Width:=... K.
  2. Do you need pointer to raw image data (say RGB bytes for 24 bit/px images - ScanLine), or pointer to data which you saved to ms in your example? tMemoryStream has property Memory (pointer to its data).
  3. Bitmap1.ScanLine[Bitmap1.Height-1] is start of the image buffer (raw image data, it is bottom up). Buffer size is not so easy; in VCL.Graphics, they have this function (Alignment=32; you need to multiply its result by Bitmap1.Height; look at TBitmap.GetScanLine in VCL.Graphics). function BytesPerScanline(PixelsPerScanline, BitsPerPixel, Alignment: Longint): Longint; begin Dec(Alignment); Result := ((PixelsPerScanline * BitsPerPixel) + Alignment) and not Alignment; Result := Result div 8; end;
  4. Vandrovnik

    Internationalized Domain Names (IDN)

    www.háčkyčárky.cz by CZ Domain Registry.
  5. Vandrovnik

    Internationalized Domain Names (IDN)

    On https://www.xn--hkyrky-ptac70bc.cz/ , there is an e-mail address to which you can send test e-mails and it should send you a reply, if test message was OK. (You can switch the site to English language.)
  6. Vandrovnik

    Why upgrade?

    When you are up-to-date with Delphi, it is easier to accomodate the software to new demands (such as was UTF or HDPI in the past, may be 64 bit in the future - hard to say how many years 32bit apps will be supported, new encryptions etc). Move software to another language will cost a lot of money and time (and new bugs and old features missing in the beginning).
  7. Hello, I have a tStringGrid linked to tIBQuery. In tStringGrid.OnDrawColumnCell, I would like to change font color or style in dependence of data in that column. Now I am able to do something like this: procedure TZasobaForm.grZasobaDrawColumnCell(Sender: TObject; const Canvas: TCanvas; const Column: TColumn; const Bounds: TRectF; const Row: Integer; const Value: TValue; const State: TGridDrawStates); begin Canvas.Font.Size:=grZasoba.TextSettings.Font.Size; if (Column<>nil)and(Column.Index=1) then begin Canvas.Font.Style:=[tFontStyle.fsBold]; end; Canvas.Fill.Color:=TAlphaColorRec.Black; Canvas.FillText(Bounds, (Value.AsString), false, 1, [], TTextAlign.taLeading, TTextAlign.taCenter); end; But instead of using if Column.Index=..., I would like to use something like if Column.DataField='PRICE'... How can I obtain field name for the Column? Columns can be moved on runtime, so I cannot expect that Price is always second column in the grid. In .fmx, there is: object grZasoba: TStringGrid Align = Client CanFocus = True ClipChildren = True Size.Width = 391.000000000000000000 Size.Height = 208.000000000000000000 Size.PlatformDefault = False TextSettings.Trimming = None StyledSettings = [Family, Style, FontColor] TabOrder = 1 RowCount = 0 Options = [ColumnResize, ColumnMove, ColLines, RowLines, RowSelect, AlwaysShowSelection, Tabs, Header, HeaderClick] DefaultDrawing = False OnDrawColumnCell = grZasobaDrawColumnCell Viewport.Width = 387.000000000000000000 Viewport.Height = 183.000000000000000000 end object BindSourceZasoba: TBindSourceDB DataSet = qZasoba ScopeMappings = <> Left = 88 Top = 240 end object BindingsList1: TBindingsList Methods = <> OutputConverters = <> Left = 20 Top = 5 object LinkGridToDataSourceBindSourceDB12: TLinkGridToDataSource Category = 'Quick Bindings' DataSource = BindSourceZasoba GridControl = grZasoba Columns = < item MemberName = 'PRICE' Width = 40 end ... Kind regards, Karel
  8. Vandrovnik

    tStringGrid.OnDrawColumnCell - hot to get column field name?

    Thank you for helping me to get the right way!
  9. Vandrovnik

    tStringGrid.OnDrawColumnCell - hot to get column field name?

    So, partial solution... Works with field names (does not depend on headers), works when columns are moved. Works, when data is reloaded from database. But does not keep column width, when user changes the width in runtime (I did not find any event for column width change). // defined as private member in form: grZasobaLink: TLinkGridToDataSource; // I do not know how to obtain BindingsList directly from the StringGrid, so I am passing it as param function GetLinkToDataSource(aBindingsList: tBindingsList; aGrid: tStringGrid): TLinkGridToDataSource; var a: integer; BindComponent: tContainedBindComponent; begin result:=nil; if (aBindingsList=nil)or(aGrid=nil) then exit; for a:=0 to aBindingsList.BindCompCount-1 do begin BindComponent:=aBindingsList.BindComps[a]; if (BindComponent.ControlComponent=aGrid)and(BindComponent is tLinkGridToDatasource) then begin result:=tLinkGridToDatasource(BindComponent); exit; end; end; end; // keep the link, since I will need it often procedure TZasobaForm.FormCreate(Sender: TObject); ... grZasobaLink:=GetLinkToDataSource(BindingsList1, grZasoba); end; procedure TZasobaForm.grZasobaDrawColumnCell(Sender: TObject; const Canvas: TCanvas; const Column: TColumn; const Bounds: TRectF; const Row: Integer; const Value: TValue; const State: TGridDrawStates); var FieldName: string; begin Canvas.Font.Size:=grZasoba.TextSettings.Font.Size; if Assigned(grZasobaLink) then FieldName:=UpperCase(grZasobaLink.Columns[Column.Index].MemberName) // Field name! :-) else FieldName:=''; if (FieldName='FYZICKA') then begin Canvas.Font.Style:=[tFontStyle.fsBold]; end; Canvas.Fill.Color:=TAlphaColorRec.Black; Canvas.FillText(Bounds, (Value.AsString), false, 1, [], TTextAlign.Leading, TTextAlign.Center); end; // handle column move procedure TZasobaForm.grZasobaColumnMoved(Column: TColumn; FromIndex, ToIndex: Integer); begin if Assigned(grZasobaLink) then grZasobaLink.Columns[FromIndex].Index:=ToIndex; end;
  10. Vandrovnik

    tStringGrid.OnDrawColumnCell - hot to get column field name?

    I suppose this information already is stored somewhere, so I would like to find it and use it. I cannot rely on the header, but of course I could use tag, build my own list or something like that. It seems that this connection between tStringGrid and data is also partly broken - well, in runtime I can move columns and set their width with mouse, but when the grid is filled again, order and width of columns are lost (this happens in my case when user selects another master record - data for details in the grid has to reload from database, columns where supposed to keep their position and width).
  11. I know, but from these graphs it is still pretty well visible, that issues stay in the queue/stack/whatever longer and longer and that new issues come faster then old issues are resolved. 800 days and increasing, that is a terrible value. I understand they they want to keep up to date with new Android, new iOS etc., but still I believe that they should have a team, which will resolve reported bugs.
  12. I know... And bugs resolved as "will not repair" (ie Translation Manager), bugs marked as duplicate... But the tendency in the graph is the same as my internal feeling in last years.
  13. Yeeees, that is exactly what I was searching for! Nice graphs (with sad data in it). Please can you tell me how to get these graphs from quality.embarcadero.com?
  14. Well, I tried - but when I use (the top one) Export - Excel (all fields), it exports only 1000 issues of more then 16000... May be there is a better way and I just do not see it.
  15. May be Embarcadero could explain how they decide what to do and what to postpone... and postpone...? Because when I compare Embarcadero with TMS or Fastreport (or you), it is often reaction several years vs. several days, which I really do not like. Even https://quality.embarcadero.com/browse/RSP-24548, which should take +- 2 minutes to repair, will probably be there open for years. And please do not argument that it will take much more time because of testing, because the "testing" I can see each day in Object Inspector, which is not showing last letters in text (reported more than a year ago, but did they notice by themselves when testing?), and in Projects (which stops to show its content in 10.3.3 sometimes), and in Toolbars, which are moved randomly each day... I would like to see a statistic, how reported and solved issues develop over years. May be it is somewhere on the web, I do not know.
  16. Vandrovnik

    tStringGrid.OnDrawColumnCell - hot to get column field name?

    Thank you for the answer, but tColumn.Header contains DisplayLabel of the field (which will change with translations to other languages, so I cannot depend on it). There must be the field name, somewhere 🙂
  17. Vandrovnik

    javascript errors from IDE ?

    Well, you can try to disable Start page and you will see... If it does not help, you can enable it again (remove the underscore). On my PCs, disabling Start page removed these annoying messages about script errors.
  18. Vandrovnik

    javascript errors from IDE ?

    Start page? I make this change in registry after installation (add "_" before "Start"): HKEY_CURRENT_USER\Software\Embarcadero\BDS\20.0\Known IDE Packages $(BDS)\Bin\startpageide260.bpl = _Start Page IDE Package
  19. Vandrovnik

    Combining bitmaps and preserving antialiased text quality...

    uses Direct2D; procedure TMainForm.PaintBox1Paint(Sender: TObject); var D2Canvas: TDirect2DCanvas; begin D2Canvas:=TDirect2DCanvas.Create(PaintBox1.Canvas, PaintBox1.ClientRect); try D2Canvas.BeginDraw; try D2Canvas.Brush.Style:=bsSolid; D2Canvas.Brush.Color:=clFuchsia; D2Canvas.FillRect(PaintBox1.ClientRect); D2Canvas.Font.Size:=32; D2Canvas.Font.Color:=clBlack; D2Canvas.TextOut(100, 100, 'Delphi 25th'); finally D2Canvas.EndDraw; end; finally FreeAndNil(D2Canvas); end; end; This is not OK?
  20. Vandrovnik

    Combining bitmaps and preserving antialiased text quality...

    Hello, as David already wrote - just render the text on the map, there is no need to render it to a bitmap and then merge bitmaps. Do you need to print the result? Because that was a pain with Direct2D and Delphi 😕
  21. Vandrovnik

    Combining bitmaps and preserving antialiased text quality...

    Please have a look at http://docwiki.embarcadero.com/RADStudio/Rio/en/Using_the_Direct2D_Canvas
  22. Vandrovnik

    Combining bitmaps and preserving antialiased text quality...

    Recently I have changed drawing to Direct2D, where transparency is not a problem.
  23. Vandrovnik

    VERY SMALL IDE font sizes

    Af far as I know, IDE is not HDPI aware (yet), so it will be blured...
  24. Vandrovnik

    Quality central down

    Hello, is there a way how to report to Embarcadero, that https://quality.embarcadero.com/ is down (again)?
  25. Vandrovnik

    Quality central down

    Usually when one has to change important DNS record, he wants to minimalize problems for users. Here is a description how to do it in a better way than just to change record with TTL 3 days: https://www.dnswatch.info/articles/dns-update
×