Jump to content

Search the Community

Showing results for tags 'devx'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. Larry Hengen

    AV Accessing EditValue in DevExpress Editors

    I am using an ancient version (17.1.5) of the ExpressEditors and have a simple frame in which I am attempting to validate one editor based on the contents of two others. From what I have found on-line and in the help it seems to me that accessing the EditValue of a TcxCustomEdit descendant should be fine at run-time, but I get an AV or other error in the debugger (Berlin) and the application does not behave correctly. i have explored all other public properties as well, and none seem appropriate. Anyone know the cause without tracing through all the DevExpress code? In the TFrameDailyHours.editHoursPropertiesValidate method I am attempting to make sure the Hours edit does not contain a value that exceeds the difference of the two other time edit controls: unit UnitFrameDailyHours; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit, cxSpinEdit, cxTextEdit, cxMaskEdit, cxTimeEdit, Vcl.StdCtrls, Vcl.ExtCtrls; type TFrameDailyHours = class(TFrame) PanelDay7: TPanel; labelDayofWeek: TStaticText; CheckBoxOvernight: TCheckBox; TimeEditStart: TcxTimeEdit; TimeEditStop: TcxTimeEdit; editHours: TcxSpinEdit; procedure TimeEditStartPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); procedure TimeEditStopPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); procedure editHoursPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); public end; implementation {$R *.dfm} procedure TFrameDailyHours.TimeEditStartPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); begin ErrorText := ''; //Start Date is a required field Error := VarIsNull(DisplayValue); if Error then ErrorText := 'Start of Time Range cannot be Empty'; Exit; //if we have a StopTime then the StartTime must be < StopTime Error := (DisplayValue >= TimeEditStop.EditValue); if Error then ErrorText := 'Start of Time Range must precede End of Time Range'; end; procedure TFrameDailyHours.TimeEditStopPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); begin ErrorText := ''; if not (DisplayValue = EmptyStr) then begin Error := (DisplayValue < TimeEditStart.EditValue); if Error then ErrorText := 'End of Time Range must be Empty or after Start of Time Range'; end; end; procedure TFrameDailyHours.editHoursPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); begin ErrorText := ''; Error := False; if not (TimeEditStart.DisplayValue = '00:00:00') and not (TimeEditStop.DisplayValue = '00:00:00') then begin Error := VarIsNull(DisplayValue); if Error then begin ErrorText := 'Hours cannot be Empty'; Exit; end; Error := (DisplayValue < 0) or (DisplayValue > 24); if Error then begin ErrorText := 'Hours must be > 0 and < 24'; Exit; end; //check that Hours does not exceed duration between Start and Stop Times if TimeEditStop.EditValue > TimeEditStart.EditValue then begin Error := (TimeEditStop.EditValue - TimeEditStart.EditValue) * 24 < DisplayValue; if Error then begin ErrorText := 'Hours exceeds duration between Start and End Times'; Exit; end; end; end; end; end.
×