Jump to content

rgreat

uniGUI Subscriber
  • Posts

    421
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by rgreat

  1. 22 minutes ago, Sherzod said:

    Why do you need this?

    One possible solution I think:

    
    procedure TMainForm.UniFormReady(Sender: TObject);
    begin
      with UniPanel1 do
      begin
        Caption := 'this is first line<br>this is second line';
        JSInterface.JSCode('Ext.get('#1'.id+"_td").setHtml("'+ Caption +'");');
      end;
    end;

     

    UniPanel1.JSInterface.JSCode('Ext.get('#1'.id+"_td").setHtml("'+UniPanel1.Caption+'");');

    Error:

    Cannot read property 'setHtml' of null

  2. Workaround for someone who might be interested:

    .mygrid div table td div{
        text-align: center !important;
    }
    
    .mygrid div table td:nth-child(1) div{
        text-align: left !important;
    }
    
    .mygrid div table:nth-child(1)  td div{
        text-align: center !important;
    }
    
    .mygrid div table:nth-child(2)  td:nth-child(1) div{
        text-align: right !important;
    }

    And set  grid LayoutConfig.Cls to 'mygrid'.

    image.png.d4edafb91d5271a0a241009f509d73b1.png

    • Like 1
  3. I managed to design this grid, but I can not set cell text alignment.

    image.png.f488d396d1d81df41c2cc191181352ce.png

    I cannot seems to currectly use Attribs.Style SG0DrawCell event.

    procedure TMain.SG0DrawCell(Sender: TObject; ACol, ARow: Integer; var Value: string; Attribs: TUniCellAttribs);
    begin
      Attribs.Font.Size:=10;
      Attribs.Font.Style:=[fsBold];
    
      if ARow=0 then begin
        Attribs.Font.Color:=clBlack;
      end else begin
        if ACol=0 then begin
          Attribs.Font.Color:=rgb(0,32,96);
          Attribs.Color:=rgb(152,152,152);
        end else begin
          Attribs.Font.Color:=clBlack;
          Attribs.Color:=rgb(213,213,213);
        end;
        Attribs.Style.Style := 'text-align: center;'; // <- this like breaks all previous settings and does not seems to do anything itself.
      end;

    Can someone give out example of setting cell styles through OnDrawCell event?

    I would also like to know how to disable cell selection rectangle drawing.

  4. On 9/6/2019 at 7:25 AM, Sherzod said:

    Hi,

    Can you make a simple testcase for this?..

    procedure TMainForm.UniComboBox1RemoteQuery(const QueryString: string; Result: TStrings);
    var
      i: Integer;
    begin
      Result.Clear;
      for i:=1 to 9 do begin
        Result.Add(i.ToString);
      end;
    end;

    1.

     image.png.0e0bd27fd1273572feb84de533bdd194.png

    2.

    image.png.ca673972a06f400e2ea404bca9f5c257.png

     

    Even if you change UniCombobox.Style to csDropDownList nothing will change. 

    ItemIndex will still be -1.

    This make impossible to reliably select item in list unless you fallback to dirty tricks like adding ID in listbox item text.

     

    test.zip

  5. UniCombobox with remote query where you can only select items from list.

    I'd like to get UniCombobox.itemindex working with remote query enabled. Not working for me now.

    And also like to auto-revert user typed input when i exit UniCombobox if no item is selected.

    So to summarise i'd like to have UniCombobox with csDropDownList itemindex behaviour but with option to search through it like on csDropDown+remote query.

  6. 1 hour ago, Sherzod said:

    We will try to analyze.

    Thank you.

    Also i use this code to make captions to look good:

      UniSession.SetStyle('.myCpt{word-wrap: break-word; white-space: pre-line;}');
    
      for i:=0 to DBG1.Columns.Count-1 do begin
        DBG1.Columns[i].Title.Caption:='<span class="myCpt">'+DBG1.Columns[i].Title.Caption+'</span>';
      end;

    And maybe that's not the best way to make caption word wrap.

×
×
  • Create New...