Read-only edit fields

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #51813
    CheshireCat
    Participant

      Hello Pete,

      maybe that's a solution for you:

      Code:
      uses
      sSkinManager, sEdit, GraphUtil;

      type

      TsEdit = Class(sEdit.TsEdit)
      procedure WndProc(var Message: TMessage); override;
      end;

      procedure TsEdit.WndProc(var Message: TMessage);
      begin
      case Message.Msg of
      WM_PAINT:
      begin
      if ReadOnly then
      begin
      SkinData.CustomColor := True;
      Color := ColorAdjustLuma(ColorToRGB(Form1.sSkinManager1.Palette[pcEditBG]), -25, True);
      end else SkinData.CustomColor := False;
      end;
      end;
      inherited WndProc(Message);
      end;

      Example:

      [attachment=6726:sEdit.jpg]

      #51816
      Pete Williams
      Participant

        That is absolutely awesome, thank you. Will report back to confirm.

        'CheshireCat' wrote:

        Hello Pete,

        maybe that's a solution for you:

        Code:
        uses
        sSkinManager, sEdit, GraphUtil;

        type

        TsEdit = Class(sEdit.TsEdit)
        procedure WndProc(var Message: TMessage); override;
        end;

        procedure TsEdit.WndProc(var Message: TMessage);
        begin
        case Message.Msg of
        WM_PAINT:
        begin
        if ReadOnly then
        begin
        SkinData.CustomColor := True;
        Color := ColorAdjustLuma(ColorToRGB(Form1.sSkinManager1.Palette[pcEditBG]), -25, True);
        end else SkinData.CustomColor := False;
        end;
        end;
        inherited WndProc(Message);
        end;

        Example:

        [attachment=6726:sEdit.jpg]

        #51830
        Support
        Keymaster

          Other solution: you can try to change the SkinData.SkinSection property. To 'PANEL_LOW', for instance.

          #51845
          JasonToms
          Participant
            'Support' wrote:

            Other solution: you can try to change the SkinData.SkinSection property. To 'PANEL_LOW', for instance.

            Perfect, thanks.

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.