Jump to content


Photo

NxDatePicker is not support cyrillic word in DayNames


  • Please log in to reply
16 replies to this topic

#1 Alexandr

Alexandr
  • Members
  • 21 posts
  • Gender:Male

Posted 11 October 2010 - 09:20 PM

I will set days (Пн, Вт, Ср, Чт, Пт, Сб, В?), and set font as Ms_Sans_Serif (Charset=Russian_Charset), but words not visible (pic1).
If i set english words in DayNames, then it work (pic2), but visible only one first char (i set 'mo', visible 'm'). It`s normaly?

Attached Files



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 11 October 2010 - 09:27 PM

Hello Alexandr,

Can you please create one form and place this datepicker (with Russian chars) on it and post it here.

I don't have much experience with different charsets and this may help.

Thank you.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 11 October 2010 - 09:28 PM

Update: Only one letter is shown when days of week are painted.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 Alexandr

Alexandr
  • Members
  • 21 posts
  • Gender:Male

Posted 11 October 2010 - 09:34 PM

QUOTE (Boki (Berg) @ Oct 12 2010, 12:27 AM) <{POST_SNAPBACK}>
Hello Alexandr,

Can you please create one form and place this datepicker (with Russian chars) on it and post it here.

I don't have much experience with different charsets and this may help.

Thank you.

Best regards


in attachment - project (in zip)

Attached Files



#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 11 October 2010 - 09:54 PM

Hello Alexandr,

For some reason I don't get month name in Russian, and all day names are in ? chars. Do I need to do something more?

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#6 Alexandr

Alexandr
  • Members
  • 21 posts
  • Gender:Male

Posted 11 October 2010 - 09:59 PM

QUOTE (Boki (Berg) @ Oct 12 2010, 12:54 AM) <{POST_SNAPBACK}>
Hello Alexandr,

For some reason I don't get month name in Russian, and all day names are in ? chars. Do I need to do something more?

Best regards


ok. Problem in charset for DayNames. All time it set as Latin, and not can change (((

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 11 October 2010 - 10:07 PM

Hello Alexandr,

Please try to update next line in NxEdit.pas

CODE
procedure TNxDatePicker.BeforeDrop(var APoint: TPoint);
var
    y, m, d: Word;
begin
  inherited;
  with FPopupControl as TNxDatePopup do
  begin
    Font.Assign(Self.Font); // <----------- new line
    NoneButton.Text := FNoneCaption;
    if AsDateTime = 0 then SelectedDate := Today { don't show 1899 year }
      else SelectedDate := GetAsDateTime;
    DecodeDate(SelectedDate, y, m, d);
    DayNames := Self.FDayNames;
    Year := y;
    Month := m;
    Day := d;
    StartDay := FStartDay;
    TodayButton.Text := FTodayCaption;
      Height := 163;
      Width := 151;
    MonthNames := Self.MonthNames;
    NoneButton.Visible := ShowNoneButton;
    if NoneButton.Visible then TodayButton.Left := 20
      else TodayButton.Left := ClientWidth div 2 - TodayButton.Width div 2;
  end;
end;


I am not sure that this will help, but you may try.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#8 Alexandr

Alexandr
  • Members
  • 21 posts
  • Gender:Male

Posted 12 October 2010 - 01:36 AM

QUOTE (Boki (Berg) @ Oct 12 2010, 01:07 AM) <{POST_SNAPBACK}>
Hello Alexandr,

Please try to update next line in NxEdit.pas

CODE
procedure TNxDatePicker.BeforeDrop(var APoint: TPoint);
var
    y, m, d: Word;
begin
  inherited;
  with FPopupControl as TNxDatePopup do
  begin
    Font.Assign(Self.Font); // <----------- new line
    NoneButton.Text := FNoneCaption;
    if AsDateTime = 0 then SelectedDate := Today { don't show 1899 year }
      else SelectedDate := GetAsDateTime;
    DecodeDate(SelectedDate, y, m, d);
    DayNames := Self.FDayNames;
    Year := y;
    Month := m;
    Day := d;
    StartDay := FStartDay;
    TodayButton.Text := FTodayCaption;
      Height := 163;
      Width := 151;
    MonthNames := Self.MonthNames;
    NoneButton.Visible := ShowNoneButton;
    if NoneButton.Visible then TodayButton.Left := 20
      else TodayButton.Left := ClientWidth div 2 - TodayButton.Width div 2;
  end;
end;


I am not sure that this will help, but you may try.

Best regards


absolutely no changes ((((
that interest:
we need - change charset to RUSSIAN_CHARSET in location (see pic1). But we have a problem: Charset changes for all NxDatePicker without location, marked red line (pic2). I tested change charset to all variants, and charset change for marked red line at "SYMBOL_CHARSET". All another charsets not influence to visual marked. And, marked green line may be change font color, whereas all another NxDatePicker not will change any font.

#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 12 October 2010 - 01:39 AM

Hello Alexandr,

It is interesting that October is well written in Cyrillic.

I am a little bit out of ideas. I will try tomorrow again.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#10 Alexandr

Alexandr
  • Members
  • 21 posts
  • Gender:Male

Posted 13 October 2010 - 01:06 AM

QUOTE (Boki (Berg) @ Oct 12 2010, 04:39 AM) <{POST_SNAPBACK}>
Hello Alexandr,

It is interesting that October is well written in Cyrillic.

I am a little bit out of ideas. I will try tomorrow again.

Best regards


i think, what NxDatePicker useless for me (((
return to DateTimePicker - it work fine

#11 Alexandr

Alexandr
  • Members
  • 21 posts
  • Gender:Male

Posted 13 October 2010 - 10:07 AM

what very interest - in NxMonthCalendar not available problem that NxDatePicker.

#12 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 13 October 2010 - 11:47 PM

Hi,

I don't know why Font settings are not translated to popup control of NxDatePicker (?!).

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#13 Alexandr

Alexandr
  • Members
  • 21 posts
  • Gender:Male

Posted 17 October 2010 - 09:33 PM

QUOTE (Boki (Berg) @ Oct 14 2010, 02:47 AM) <{POST_SNAPBACK}>
Hi,

I don't know why Font settings are not translated to popup control of NxDatePicker (?!).

Best regards

Hello!
May be write about this problem to developers? It should help.

#14 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 17 October 2010 - 09:54 PM

Hello Alexandr,

Sure, why not. smile.gif

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#15 Alexandr

Alexandr
  • Members
  • 21 posts
  • Gender:Male

Posted 31 August 2012 - 10:28 PM

Hello!
This problem in WideChar (delphi 7). Need use only AnsiChar (char) in interface program.

In NxPopupControl.pas need change this function:

 TNxDatePopup = class(TNxPopupControl)
  ...
    function GetDayInWeekChar(DayInWeek: Integer): Char; // dmajkic Char -> WideChar
 ...

implementation
 
function TNxDatePopup.GetDayInWeekChar(DayInWeek: Integer): Char;
begin
  Result := ' ';
 if Assigned(FDayNames) and InRange(DayInWeek, 1, 7)
    and (FDayNames.Count >= 7) then Result := Char(FDayNames[DayInWeek - 1][1]) else
  case GetActualStartDay of
    dwSunday: Result := Char(LongDayNames[DayInWeek][1]);
    dwMonday: if DayInWeek = 7 then Result := Char(LongDayNames[1][1])
	  else Result := Char(LongDayNames[DayInWeek + 1][1]);
  end;

{
 is old version
 if Assigned(FDayNames) and InRange(DayInWeek, 1, 7)
    and (FDayNames.Count >= 7) then Result := WideChar(FDayNames[DayInWeek - 1][1]) else
  case GetActualStartDay of
    dwSunday: Result := WideChar(LongDayNames[DayInWeek][1]);
    dwMonday: if DayInWeek = 7 then Result := WideChar(LongDayNames[1][1])
	  else Result := WideChar(LongDayNames[DayInWeek + 1][1]);
  end;}

end;
 


These changes solved my problem.

#16 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 01 September 2012 - 07:13 PM

Hi,

I need to review this change. It may take some time.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#17 Alexandr

Alexandr
  • Members
  • 21 posts
  • Gender:Male

Posted 03 September 2012 - 09:59 PM

Hello!
It actually only for Delphi7. Delphi7 have some problems in multilanguage interface.
I'm currently using a string, not a char.

............
function GetDayInWeekChar(DayInWeek: Integer): string;

...........
implementation

function TNxDatePopup.GetDayInWeekChar(DayInWeek: Integer): string;
begin
  Result := '  ';

if Assigned(FDayNames) and InRange(DayInWeek, 1, 7)
	and (FDayNames.Count >= 7) then Result := copy(FDayNames[DayInWeek - 1],1,2) else
  case GetActualStartDay of
	dwSunday: Result := copy(LongDayNames[DayInWeek],1,2);
	dwMonday: if DayInWeek = 7 then Result := copy(LongDayNames[1],1,2)
							   else Result := copy(LongDayNames[DayInWeek + 1],1,2);
end;

end;

It was forced, as one symbol in Cyrillic can be difficult as the day of the week (п в с ч п с в).
Common to use 2 symbols (пн вт ср чт пт сб вс).

Attached File  pic1.png   8.85KB   1 downloads




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users