Alex47
Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Alex1978 Может вам поможет это http://216.101.185.148/scripts/isapi.dll/article?id=2580214D&article=5282067 Сам я не пробовал. Ниже идут цитаты: Вопрос: Do you know if it's possible to enter only day+month and cxDateEdit fills in the current year ? Ответ: He can type any of the following: 7 7/6 7 6 7_6 7_6_4 Код для этого: ------------------------------------- OnValidate Event DisplayValue := DateToStr(GetInputDate(EditText)); Error:=False; ------------------------------------- And here is the GetInputDate function.. type TDateType = (dtDDMMYYYY, dtYYYYMMDD); function GetInputDate(Input: String): TDate; var date: TDateTime; Year, Month, tmpMonth, Day: Word; sYear, sMonth, sDay: string; function BreakbyPos(var aLine: String; CutPos: integer): String; begin if CutPos>0 then begin Result:=copy(aLine,1,CutPos); System.delete(aLine,1,CutPos); end else begin result:=aLine; aLine:=''; end; end; function CompleteYear(year: word): word; begin Result := 0; case year of 0..99: Result := year + 1900; 100..999: Result := year + 1000; 1000..9999: Result := year; end; if Result < 1930 then Result := Result + 100; end; function getMonthMaxDay(month: word): word; begin Result:=0; case month of 1,3,5,7,8,10,12: Result:=31; 4,6,9,11: Result:=30; 2: Result:=27; end; end; function GetIntFromStr(var aLine: string; MaxDigit: integer; IsDate: boolean): string; var i: integer; tmp: string; plus: boolean; Year, Month, Day: Word; begin Result := EmptyStr; plus := false; tmp := BreakbyPos(aLine, 1); while not IsValidInt(tmp) and (tmp<>EmptyStr) do begin if tmp = '+' then plus := true; tmp := BreakbyPos(aLine, 1); end; i:=0; while IsValidInt(tmp) do begin inc(i); Result := Result + tmp; if i >= MaxDigit then break; tmp := BreakbyPos(aLine, 1); end; if IsDate and plus then begin i := StrToInt(Result); DecodeDate(now, Year, Month, Day); Day := Day + i; if Day > getMonthMaxDay(Month) then Day := getMonthMaxDay(Month); Result := IntToStr(Day); end; end; begin case FDateType of dtDDMMYYYY: begin sDay := GetIntFromStr(input, 2, true); sMonth := GetIntFromStr(input, 2, false); sYear := GetIntFromStr(input, 4, false); end; dtYYYYMMDD: begin sYear := GetIntFromStr(input, 4, false); sMonth := GetIntFromStr(input, 2, false); sDay := GetIntFromStr(input, 2, true); end; end; DecodeDate(now, Year, Month, Day); tmpMonth := Month; if sYear <> EmptyStr then Year := StrToInt(sYear); if sMonth <> EmptyStr then Month := StrToInt(sMonth); if Month > 12 then Month := tmpMonth; if sDay <> EmptyStr then Day := StrToInt(sDay); Year := CompleteYear(Year); result := 0; if TryEncodeDate(Year, Month, Day, date) then result := date; end; Добавлено: aincube DevExpress рекомендует такой порядок: If you decide to rebuild the ExpressQuantumGrid packages, please recompile them in the following order: XP Theme manager: dxThemeD{C}X.dpk CX Library: cxLibraryVCLD{C}X.dpk dclcxLibraryVCLD{C}X.dpk ExpressDataController: cxDataD{C}X.dpk cxBDEAdaptersD{C}X.dpk cxADOAdaptersD{C}X.dpk cxIBXAdaptersD{C}X.dpk ExpressEditors Library: cxEditorsVCLD{C}X.dpk cxExtEditorsVCLD{C}X.dpk dclcxEditorsVCLD{C}X.dpk dclcxExtEditorsVCLD{C}X.dpk ExpressQuantumGrid cxExportVCLD{C}X.dpk cxGridVCLD{C}X.dpk dclcxGridVCLD{C}X.dpk Но я думаю будет проще использовать bat файлы feandy... |