⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 itemproprvfrm.pas

📁 richviewaction 1.58 需要richview 1.9.46
💻 PAS
📖 第 1 页 / 共 3 页
字号:
      if UCHS then
        CellHSpacing := CHS;
      if UCVS then
        CellVSpacing := CVS;
      if (CellHSpacing=CellVSpacing) and
         (BorderHSpacing=BorderVSpacing) and
         (BorderHSpacing=CellHSpacing) then
        seCellSpacing.Value := BorderHSpacing
      else
        seCellSpacing.Indeterminate := True;
    end;
  finally
    frm.Free;
  end;
end;

procedure TfrmRVItemProp.seCellSpacingChange(Sender: TObject);
begin
  if not Visible then
    exit;
  if not seCellSpacing.Indeterminate then begin
    BorderHSpacing := seCellSpacing.AsInteger;
    BorderVSpacing := BorderHSpacing;
    CellHSpacing := BorderHSpacing;
    CellVSpacing := BorderHSpacing;
  end;
end;

procedure TfrmRVItemProp.btnTableBorderClick(Sender: TObject);
var frm: TfrmRVTableBrdr;
begin
  frm := TfrmRVTableBrdr.Create(Application);
  try
    frm.ColorDialog := ColorDialog;
    frm.SetFormCaption(RVA_GetS(rvam_ip_TableBorderTitle));
    frm.SetData(BorderStyle, BorderColorL, BorderColorD, BorderWidth);
    if frm.ShowModal=mrOk then begin
      frm.GetData(BorderStyle, BorderColorL, BorderColorD, BorderWidth);
    end;
  finally
    frm.Free;
  end;
end;

procedure TfrmRVItemProp.btnCellBordersClick(Sender: TObject);
var frm: TfrmRVTableBrdr;
begin
  frm := TfrmRVTableBrdr.Create(Application);
  try
    frm.ColorDialog := ColorDialog;
    frm.SetFormCaption(RVA_GetS(rvam_ip_CellBorderTitle));
    frm.SetData(CellBorderStyle, CellBorderColorL, CellBorderColorD, CellBorderWidth);
    if frm.ShowModal=mrOk then begin
      frm.GetData(CellBorderStyle, CellBorderColorL, CellBorderColorD, CellBorderWidth);
      UpdateCellBorders;
    end;
  finally
    frm.Free;
  end;
end;

procedure TfrmRVItemProp.UpdateCellBorders;
begin
  if CellBorderWidth=0 then begin
    _gbCellBorder.Visible := False;
    exit;
  end;
  _gbCellBorder.Visible := True;
  case CellBorderStyle of
   rvtbRaised, rvtbLowered:
     begin
       _lblCellBorderColor.Visible := False;
       cmbCellBorderColor.Visible := False;
       _lblCellBorderLightColor.Visible := False;
       cmbCellBorderLightColor.Visible := False;
     end;
   rvtbRaisedColor, rvtbLoweredColor:
     begin
       _lblCellBorderColor.Visible := True;
       cmbCellBorderColor.Visible := True;
       _lblCellBorderLightColor.Visible := True;
       cmbCellBorderLightColor.Visible := True;
       cmbCellBorderColor.AutoColor := CellBorderColorD;
       cmbCellBorderLightColor.AutoColor := CellBorderColorL;
       SetControlCaption(_lblCellBorderColor, RVA_GetS(rvam_ip_CellShadowColor));
       if FDefCellColorD and not cmbCellBorderColor.Indeterminate then
         cmbCellBorderColor.ChosenColor := cmbCellBorderColor.AutoColor;
       if FDefCellColorL and not cmbCellBorderLightColor.Indeterminate then
         cmbCellBorderLightColor.ChosenColor := cmbCellBorderLightColor.AutoColor;
     end;
   rvtbColor:
     begin
       _lblCellBorderColor.Visible := True;
       cmbCellBorderColor.Visible := True;
       _lblCellBorderLightColor.Visible := False;
       cmbCellBorderLightColor.Visible := False;
       cmbCellBorderColor.AutoColor := CellBorderColorD;
       SetControlCaption(_lblCellBorderColor,  RVA_GetS(rvam_ip_CellBorderColor));
       if FDefCellColorD and not cmbCellBorderColor.Indeterminate then
         cmbCellBorderColor.ChosenColor := cmbCellBorderColor.AutoColor;
     end;
  end;
end;

procedure TfrmRVItemProp.cmbCellBorderColorColorChange(Sender: TObject);
begin
  if not cmbCellBorderColor.Indeterminate then
    FDefCellColorD := cmbCellBorderColor.ChosenColor=cmbCellBorderColor.AutoColor;
end;

procedure TfrmRVItemProp.cmbCellBorderLightColorColorChange(
  Sender: TObject);
begin
  if not cmbCellBorderLightColor.Indeterminate then
    FDefCellColorL := cmbCellBorderLightColor.ChosenColor=cmbCellBorderLightColor.AutoColor;
end;

procedure TfrmRVItemProp.seCellBestWidthChange(Sender: TObject);
begin
  if not Visible then
    exit;
  if not seCellBestWidth.Indeterminate then
    SetXBoxItemIndex(_cmbCellBWType, 1);
end;

procedure TfrmRVItemProp.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);

   procedure SwitchBtn(btn: TSpeedButton);
   begin
     btn.Down := not btn.Down;
     if Assigned(btn.OnClick) then
       btn.OnClick(btn);
   end;

begin
  if not IsTabSheetVisible(_tsCells) or not _gbCellBorder.Visible then
    exit;
  if ssCtrl in Shift then
    case Key of
    ord('L'):
      SwitchBtn(btnLeft);
    ord('T'):
      SwitchBtn(btnTop);
    ord('R'):
      SwitchBtn(btnRight);
    ord('B'):
      SwitchBtn(btnBottom);
    end;
end;

procedure TfrmRVItemProp.btnTopClick(Sender: TObject);
begin
  if Sender is TSpeedButton then
    TSpeedButton(Sender).Flat := False;
end;

procedure TfrmRVItemProp.Localize;
begin
  inherited;
  btnOk.Caption := RVA_GetS(rvam_btn_OK);
  btnCancel.Caption := RVA_GetS(rvam_btn_Cancel);
  Caption := {$IFDEF USERVTNT}_GetWideString{$ENDIF}(RVA_GetS(rvam_ip_Title));
  tsImage.Caption := RVA_GetSH(rvam_ip_ImageTab);
  tsImgLayout.Caption := RVA_GetSH(rvam_ip_LayoutTab);
  tsBreak.Caption := RVA_GetSH(rvam_ip_LineTab);
  tsTable.Caption := RVA_GetSH(rvam_ip_TableTab);
  tsRows.Caption := RVA_GetSH(rvam_ip_RowsTab);
  tsCells.Caption := RVA_GetSH(rvam_ip_CellsTab);
  lblPreview.Caption := RVA_GetS(rvam_ip_Preview);
  gbTransp.Caption := RVA_GetSH(rvam_ip_Transparency);
  cbTransp.Caption := RVA_GetS(rvam_ip_Transparent);
  lblTrColor.Caption := RVA_GetS(rvam_ip_TrColor);
  btnChangeImage.Caption := RVA_GetS(rvam_ip_Change);
  gbVAlign.Caption := RVA_GetSH(rvam_ip_VAlign);
  lblAlignTo.Caption := RVA_GetS(rvam_ip_VAlignValue);
  cmbAlignTo.Items[0] := RVA_GetS(rvam_ip_VAlign1);
  cmbAlignTo.Items[1] := RVA_GetS(rvam_ip_VAlign2);
  lblVShift.Caption := RVA_GetS(rvam_ip_ShiftBy);
  gbSize.Caption := RVA_GetSH(rvam_ip_Stretch);
  lblWidth.Caption := RVA_GetS(rvam_ip_Width);
  lblHeight.Caption := RVA_GetS(rvam_ip_Height);
  cmbVShiftType.Items[0] := RVA_GetS(rvam_Percents);
  cmbVShiftType.Items[1] := RVA_GetS(rvam_Pixels);
  cmbWType.Items[0] := RVA_GetS(rvam_Percents);
  cmbWType.Items[1] := RVA_GetS(rvam_Pixels);
  cmbHType.Items[0] := RVA_GetS(rvam_Percents);
  cmbHType.Items[1] := RVA_GetS(rvam_Pixels);
  gbBreak.Caption :=  RVA_GetSH(rvam_ip_HorzLine);
  lblBreakColor.Caption := RVA_GetS(rvam_ip_HLColor);
  lblBreakWidth.Caption := RVA_GetS(rvam_ip_HLWidth);

  gbTableSize.Caption := RVA_GetSH(rvam_ip_TableGB);
  lblTableWidth.Caption := RVA_GetS(rvam_ip_TableWidth);
  lblTableColor.Caption := RVA_GetS(rvam_ip_TableColor);
  lblCellPadding.Caption := RVA_GetS(rvam_ip_CellPadding);
  lblCellSpacing.Caption := RVA_GetS(rvam_ip_CellSpacing);
  btnTableBorder.Caption := RVA_GetS(rvam_ip_TableBorder);
  btnCellBorder.Caption := RVA_GetS(rvam_ip_CellBorder);
  btnSpacing.Caption := RVA_GetS(rvam_ip_More);

  gbTablePrint.Caption := RVA_GetSH(rvam_ip_TablePrinting);
  cbNoSplit.Caption := RVA_GetS(rvam_ip_KeepOnPage);
  lblHeadingRows.Caption := RVA_GetS(rvam_ip_HeadingRows);
  lblHeadingRowsTip.Caption := RVA_GetS(rvam_ip_HeadingRowsTip);
  cmbTWType.Items[0] := RVA_GetS(rvam_Percents);
  cmbTWType.Items[1] := RVA_GetS(rvam_Pixels);
  rgRowVAlign.Caption := RVA_GetSH(rvam_ip_VAlign);
  rgRowVAlign.Items[0].Caption := RVA_GetS(rvam_ip_VATop);
  rgRowVAlign.Items[1].Caption := RVA_GetS(rvam_ip_VACenter);
  rgRowVAlign.Items[2].Caption := RVA_GetS(rvam_ip_VABottom);
  gbCells.Caption := RVA_GetSH(rvam_ip_CellSettings);
  cbCellWidth.Caption := RVA_GetS(rvam_ip_CellBestWidth);
  cbCellHeight.Caption := RVA_GetS(rvam_ip_CellBestHeight);
  lblCellColor.Caption := RVA_GetS(rvam_ip_CellFillColor);
  cmbCellBWType.Items[0] := RVA_GetS(rvam_Percents);
  cmbCellBWType.Items[1] := RVA_GetS(rvam_Pixels);
  lblPixels.Caption := RVA_GetS(rvam_Pixels);
  rgCellVAlign.Caption := RVA_GetSH(rvam_ip_VAlign);
  rgCellVAlign.Items[0].Caption := RVA_GetS(rvam_ip_VATop);
  rgCellVAlign.Items[1].Caption := RVA_GetS(rvam_ip_VACenter);
  rgCellVAlign.Items[2].Caption := RVA_GetS(rvam_ip_VABottom);
  rgCellVAlign.Items[3].Caption := RVA_GetS(rvam_ip_VADefault);
  gbCellBorder.Caption := RVA_GetSH(rvam_ip_CellBorderGB);
  lblVS.Caption := RVA_GetS(rvam_ip_VisibleSides);
  btnTop.Hint    := RVA_GetS(rvam_TopSide)    + ' (Ctrl+T)|';
  btnLeft.Hint   := RVA_GetS(rvam_LeftSide)   + ' (Ctrl+L)|';
  btnBottom.Hint := RVA_GetS(rvam_BottomSide) + ' (Ctrl+B)|';
  btnRight.Hint  := RVA_GetS(rvam_RightSide)  + ' (Ctrl+R)|';
  lblCellBorderColor.Caption := RVA_GetS(rvam_ip_CellShadowColor);
  lblCellBorderLightColor.Caption := RVA_GetS(rvam_ip_CellLightColor);
  cmbColor.DefaultCaption := RVA_GetS(rvam_ip_TrAutoColor);
  btnTableBack.Caption := RVA_GetS(rvam_ip_BackgroundImage);
  btnCellBack.Caption := RVA_GetS(rvam_ip_BackgroundImage);
  gbSpacing.Caption := RVA_GetSH(rvam_ip_SpacingGB);
  lblSpacing.Caption := RVA_GetS(rvam_ip_Spacing);
  gbWeb.Caption := RVA_GetSH(rvam_ip_Web);
  lblAlt.Caption := RVA_GetS(rvam_ip_Alt);
end;

procedure TfrmRVItemProp.FormDestroy(Sender: TObject);
begin
  inherited;
  TableBackgroundImage.Free;
end;

procedure TfrmRVItemProp.btnTableBackClick(Sender: TObject);
var frm: TfrmRVTableBack;
    Color: TColor;
begin
  frm := TfrmRVTableBack.Create(Application);
  try
    Color := clNone;
    if not cmbTableColor.Indeterminate then
      Color := cmbTableColor.ChosenColor;
    frm.Init(Color, TableBackgroundStyle, TableBackgroundImage);
    frm.Filter := BackgroundFilter;    
    if frm.ShowModal=mrOk then begin
      frm.GetResult(TableBackgroundStyle, TableBackgroundImage);
      TableBackgroundChanged := True;
    end;
  finally
    frm.Free;
  end;
end;

procedure TfrmRVItemProp.btnCellBackClick(Sender: TObject);
var frm: TfrmRVTableBack;
    Color: TColor;
begin
  frm := TfrmRVTableBack.Create(Application);
  try
    Color := clNone;
    frm.Init(Color, CellBackgroundStyle, CellBackgroundImage);
    frm.Filter := BackgroundFilter;
    if frm.ShowModal=mrOk then begin
      frm.GetResult(CellBackgroundStyle, CellBackgroundImage);
      CellBackgroundChanged := True;
    end;
  finally
    frm.Free;
  end;
end;

procedure TfrmRVItemProp.cmbWidthDrawItem(Control: TWinControl;
  Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
  {$IFDEF USERVTNT}
  RVA_DrawCmbWidthItem(TTntComboBox(_cmbWidth).Canvas, Rect, Index, cmbBreakColor.ChosenColor, State);
  {$ELSE}
  RVA_DrawCmbWidthItem(TComboBox(_cmbWidth).Canvas, Rect, Index, cmbBreakColor.ChosenColor, State);
  {$ENDIF}
end;

{$IFDEF USERVKSDEVTE}
procedure TfrmRVItemProp.tecmbWidthDrawItem(Control: TWinControl;
  Canvas: TCanvas; Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
  RVA_DrawCmbWidthItem(Canvas, Rect, Index, cmbBreakColor.ChosenColor, State);
end;
{$ENDIF}

{$IFDEF RVASKINNED}
procedure TfrmRVItemProp.OnCreateThemedControl(OldControl,
  NewControl: TControl);
begin
  if OldControl =_gbTransp then
    _gbTransp := NewControl
  else if OldControl =_gbSize then
    _gbSize := NewControl
  else if OldControl =_txtAlt then
    _txtAlt := NewControl
  else if OldControl =_gbCellBorder then
    _gbCellBorder := NewControl
  else if OldControl =_cbTransp then
    _cbTransp := NewControl
  else if OldControl =_cbCellWidth then
    _cbCellWidth := NewControl
  else if OldControl =_cbCellHeight then
    _cbCellHeight := NewControl
  else if OldControl =_cbNoSplit then
    _cbNoSplit := NewControl
  else if OldControl =_cmbAlignTo then
    _cmbAlignTo := NewControl
  else if OldControl =_cmbVShiftType then
    _cmbVShiftType := NewControl
  else if OldControl =_cmbWType then
    _cmbWType := NewControl
  else if OldControl =_cmbHType then
    _cmbHType := NewControl
  else if OldControl =_cmbWidth then begin
    _cmbWidth := NewControl;
    {$IFDEF USERVKSDEVTE}
    TTeComboBox(_cmbWidth).OnDrawItem := tecmbWidthDrawItem;
    {$ENDIF}
    end
  else if OldControl =_cmbTWType then
    _cmbTWType := NewControl
  else if OldControl =_cmbCellBWType then
    _cmbCellBWType := NewControl
  else if OldControl =_lblDefSize then
    _lblDefSize := NewControl
  else if OldControl =_lblCellBorderColor then
    _lblCellBorderColor := NewControl
  else if OldControl =_lblCellBorderLightColor then
    _lblCellBorderLightColor := NewControl
  else if OldControl =_pc then begin
    _pc := TWinControl(NewControl);
    {$IFDEF USERVKSDEVTE}
    _tsImage      := TTePageControl(_pc).Pages[0];
    _tsImgLayout  := TTePageControl(_pc).Pages[1];
    _tsBreak      := TTePageControl(_pc).Pages[2];
    _tsTable      := TTePageControl(_pc).Pages[3];
    _tsRows       := TTePageControl(_pc).Pages[4];
    _tsCells      := TTePageControl(_pc).Pages[5];
    {$ENDIF}
    {$IFDEF USERVTNT}
    _tsImage      := TTntPageControl(_pc).Pages[0];
    _tsImgLayout  := TTntPageControl(_pc).Pages[1];
    _tsBreak      := TTntPageControl(_pc).Pages[2];
    _tsTable      := TTntPageControl(_pc).Pages[3];
    _tsRows       := TTntPageControl(_pc).Pages[4];
    _tsCells      := TTntPageControl(_pc).Pages[5];
    {$ENDIF}
  end;
end;

function TfrmRVItemProp.IsThemeAllowedFor(Component: TComponent): Boolean; 
begin
  if Component is TSpeedButton then
    Result := False
  else
    Result := inherited IsThemeAllowedFor(Component);
end;
{$ENDIF}



end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -