first try to make the components unicode aware on win

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@349 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
christian_u
2008-02-11 01:09:19 +00:00
parent 160abc712d
commit 75305bbd3c
6 changed files with 83 additions and 62 deletions

View File

@ -1,13 +1,15 @@
object AlarmNotifyForm: TAlarmNotifyForm object AlarmNotifyForm: TAlarmNotifyForm
Left = 322 Left = 522
Height = 210 Height = 208
Top = 254 Top = 352
Width = 410 Width = 408
HorzScrollBar.Page = 409 HorzScrollBar.Page = 407
VertScrollBar.Page = 209 VertScrollBar.Page = 207
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'Reminder' Caption = 'Reminder'
ClientHeight = 210 ClientHeight = 208
ClientWidth = 410 ClientWidth = 408
Color = clInfoBk Color = clInfoBk
KeyPreview = True KeyPreview = True
OnKeyDown = FormKeyDown OnKeyDown = FormKeyDown

View File

@ -1,40 +1,40 @@
{ Das ist eine automatisch erzeugte Lazarus-Ressourcendatei } { Das ist eine automatisch erzeugte Lazarus-Ressourcendatei }
LazarusResources.Add('TAlarmNotifyForm','FORMDATA',[ LazarusResources.Add('TAlarmNotifyForm','FORMDATA',[
'TPF0'#16'TAlarmNotifyForm'#15'AlarmNotifyForm'#4'Left'#3'B'#1#6'Height'#3#210 'TPF0'#16'TAlarmNotifyForm'#15'AlarmNotifyForm'#4'Left'#3#10#2#6'Height'#3#208
+#0#3'Top'#3#254#0#5'Width'#3#154#1#18'HorzScrollBar.Page'#3#153#1#18'VertScr' +#0#3'Top'#3'`'#1#5'Width'#3#152#1#18'HorzScrollBar.Page'#3#151#1#18'VertScro'
+'ollBar.Page'#3#209#0#7'Caption'#6#8'Reminder'#12'ClientHeight'#3#210#0#11'C' +'llBar.Page'#3#207#0#11'BorderIcons'#11#12'biSystemMenu'#0#11'BorderStyle'#7
+'lientWidth'#3#154#1#5'Color'#7#8'clInfoBk'#10'KeyPreview'#9#9'OnKeyDown'#7 +#8'bsDialog'#7'Caption'#6#8'Reminder'#12'ClientHeight'#3#208#0#11'ClientWidt'
+#11'FormKeyDown'#6'OnShow'#7#8'FormShow'#8'Position'#7#9'poDefault'#0#6'TBev' +'h'#3#152#1#5'Color'#7#8'clInfoBk'#10'KeyPreview'#9#9'OnKeyDown'#7#11'FormKe'
+'el'#6'Bevel1'#4'Left'#3'8'#1#6'Height'#3#161#0#3'Top'#2#8#5'Width'#2'Y'#0#0 +'yDown'#6'OnShow'#7#8'FormShow'#8'Position'#7#9'poDefault'#0#6'TBevel'#6'Bev'
+#6'TBevel'#6'Bevel2'#4'Left'#2#4#6'Height'#2'&'#3'Top'#3#168#0#5'Width'#3#141 +'el1'#4'Left'#3'8'#1#6'Height'#3#161#0#3'Top'#2#8#5'Width'#2'Y'#0#0#6'TBevel'
+#1#0#0#6'TLabel'#14'SubjectCaption'#4'Left'#2#8#6'Height'#2#14#3'Top'#2#3#5 +#6'Bevel2'#4'Left'#2#4#6'Height'#2'&'#3'Top'#3#168#0#5'Width'#3#141#1#0#0#6
+'Width'#2'J'#7'Caption'#6#14'SubjectCaption'#11'ParentColor'#8#0#0#6'TLabel' +'TLabel'#14'SubjectCaption'#4'Left'#2#8#6'Height'#2#14#3'Top'#2#3#5'Width'#2
+#12'NotesCaption'#4'Left'#2#8#6'Height'#2#14#3'Top'#2'0'#5'Width'#2'B'#7'Cap' +'J'#7'Caption'#6#14'SubjectCaption'#11'ParentColor'#8#0#0#6'TLabel'#12'Notes'
+'tion'#6#12'NotesCaption'#11'ParentColor'#8#0#0#6'TLabel'#13'SnoozeCaption'#4 +'Caption'#4'Left'#2#8#6'Height'#2#14#3'Top'#2'0'#5'Width'#2'B'#7'Caption'#6
+'Left'#2#10#6'Height'#2#13#3'Top'#3#181#0#5'Width'#3#20#1#9'Alignment'#7#14 +#12'NotesCaption'#11'ParentColor'#8#0#0#6'TLabel'#13'SnoozeCaption'#4'Left'#2
+'taRightJustify'#8'AutoSize'#8#7'Caption'#6#13'SnoozeCaption'#11'ParentColor' +#10#6'Height'#2#13#3'Top'#3#181#0#5'Width'#3#20#1#9'Alignment'#7#14'taRightJ'
+#8#0#0#7'TButton'#10'DismissBtn'#4'Left'#3'@'#1#6'Height'#2#25#3'Top'#2#16#5 +'ustify'#8'AutoSize'#8#7'Caption'#6#13'SnoozeCaption'#11'ParentColor'#8#0#0#7
+'Width'#2'K'#7'Caption'#6#10'DismissBtn'#7'OnClick'#7#15'DismissBtnClick'#8 +'TButton'#10'DismissBtn'#4'Left'#3'@'#1#6'Height'#2#25#3'Top'#2#16#5'Width'#2
+'TabOrder'#2#0#0#0#7'TButton'#9'SnoozeBtn'#4'Left'#3'@'#1#6'Height'#2#25#3'T' +'K'#7'Caption'#6#10'DismissBtn'#7'OnClick'#7#15'DismissBtnClick'#8'TabOrder'
+'op'#2'0'#5'Width'#2'K'#7'Caption'#6#9'SnoozeBtn'#7'OnClick'#7#14'SnoozeBtnC' +#2#0#0#0#7'TButton'#9'SnoozeBtn'#4'Left'#3'@'#1#6'Height'#2#25#3'Top'#2'0'#5
+'lick'#8'TabOrder'#2#1#0#0#7'TButton'#11'OpenItemBtn'#4'Left'#3'@'#1#6'Heigh' +'Width'#2'K'#7'Caption'#6#9'SnoozeBtn'#7'OnClick'#7#14'SnoozeBtnClick'#8'Tab'
+'t'#2#25#3'Top'#2'`'#5'Width'#2'K'#7'Caption'#6#11'OpenItemBtn'#7'Default'#9 +'Order'#2#1#0#0#7'TButton'#11'OpenItemBtn'#4'Left'#3'@'#1#6'Height'#2#25#3'T'
+#7'OnClick'#7#16'OpenItemBtnClick'#8'TabOrder'#2#2#0#0#5'TEdit'#11'SubjectEd' +'op'#2'`'#5'Width'#2'K'#7'Caption'#6#11'OpenItemBtn'#7'Default'#9#7'OnClick'
+'it'#4'Left'#2#8#6'Height'#2#21#3'Top'#2#19#5'Width'#3')'#1#8'ReadOnly'#9#8 +#7#16'OpenItemBtnClick'#8'TabOrder'#2#2#0#0#5'TEdit'#11'SubjectEdit'#4'Left'
+'TabOrder'#2#3#0#0#5'TMemo'#9'NotesMemo'#4'Left'#2#8#6'Height'#2'a'#3'Top'#2 +#2#8#6'Height'#2#21#3'Top'#2#19#5'Width'#3')'#1#8'ReadOnly'#9#8'TabOrder'#2#3
+'@'#5'Width'#3')'#1#13'Lines.Strings'#1#6#1'1'#6#1'2'#6#1'3'#6#1'4'#6#1'5'#6 +#0#0#5'TMemo'#9'NotesMemo'#4'Left'#2#8#6'Height'#2'a'#3'Top'#2'@'#5'Width'#3
+#1'6'#0#8'ReadOnly'#9#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2#4#0#0#9 +')'#1#13'Lines.Strings'#1#6#1'1'#6#1'2'#6#1'3'#6#1'4'#6#1'5'#6#1'6'#0#8'Read'
+'TComboBox'#11'SnoozeCombo'#4'Left'#3'"'#1#6'Height'#2#21#3'Top'#3#178#0#5'W' +'Only'#9#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2#4#0#0#9'TComboBox'#11
+'idth'#2'j'#16'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20'cbactSearc' +'SnoozeCombo'#4'Left'#3'"'#1#6'Height'#2#21#3'Top'#3#178#0#5'Width'#2'j'#16
+'hAscending'#0#10'ItemHeight'#2#13#13'Items.Strings'#1#6#9'5 Minutes'#6#10'1' +'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20'cbactSearchAscending'#0
+'0 Minutes'#6#10'15 Minutes'#6#10'30 Minutes'#6#10'45 Minutes'#6#7'1 Hours'#6 +#10'ItemHeight'#2#13#13'Items.Strings'#1#6#9'5 Minutes'#6#10'10 Minutes'#6#10
+#7'2 Hours'#6#7'3 Hours'#6#7'4 Hours'#6#7'5 Hours'#6#7'6 Hours'#6#7'7 Hours' +'15 Minutes'#6#10'30 Minutes'#6#10'45 Minutes'#6#7'1 Hours'#6#7'2 Hours'#6#7
+#6#7'8 Hours'#6#6'1 Days'#6#6'2 Days'#6#6'3 Days'#6#6'4 Days'#6#6'5 Days'#6#6 +'3 Hours'#6#7'4 Hours'#6#7'5 Hours'#6#7'6 Hours'#6#7'7 Hours'#6#7'8 Hours'#6
+'6 Days'#6#6'1 Week'#0#8'OnChange'#7#17'SnoozeComboChange'#11'ParentColor'#9 +#6'1 Days'#6#6'2 Days'#6#6'3 Days'#6#6'4 Days'#6#6'5 Days'#6#6'6 Days'#6#6'1'
+#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#5#0#0#18'TVpEventEditDialog'#11 +' Week'#0#8'OnChange'#7#17'SnoozeComboChange'#11'ParentColor'#9#5'Style'#7#14
+'EventDialog'#7'Version'#6#5'v1.03'#10'TimeFormat'#7#8'tf24Hour'#18'Placemen' +'csDropDownList'#8'TabOrder'#2#5#0#0#18'TVpEventEditDialog'#11'EventDialog'#7
+'t.Position'#7#11'mpCenterTop'#13'Placement.Top'#2#10#14'Placement.Left'#2#10 +'Version'#6#5'v1.03'#10'TimeFormat'#7#8'tf24Hour'#18'Placement.Position'#7#11
+#16'Placement.Height'#3#156#1#15'Placement.Width'#3#193#2#4'left'#3','#1#3't' +'mpCenterTop'#13'Placement.Top'#2#10#14'Placement.Left'#2#10#16'Placement.He'
+'op'#2'$'#0#0#0 +'ight'#3#156#1#15'Placement.Width'#3#193#2#4'left'#3','#1#3'top'#2'$'#0#0#0
]); ]);

View File

@ -125,13 +125,11 @@ begin
try try
try try
Event.AlertDisplayed := true; Event.AlertDisplayed := true;
// DoFormPlacement(AlarmNotifyForm); DoFormPlacement(AlarmNotifyForm);
AlarmNotifyForm.Color := BackgroundColor; AlarmNotifyForm.Color := BackgroundColor;
AlarmNotifyForm.DataStore := DataStore; AlarmNotifyForm.DataStore := DataStore;
AlarmNotifyForm.Event := Event; AlarmNotifyForm.Event := Event;
AlarmNotifyForm.PopulateSelf; AlarmNotifyForm.PopulateSelf;
AlarmNotifyForm.Width := 410;
AlarmNotifyForm.Height := 210;
AlarmNotifyForm.ShowModal; AlarmNotifyForm.ShowModal;
finally finally
Event.AlertDisplayed := false; Event.AlertDisplayed := false;
@ -264,6 +262,8 @@ end;
{=====} {=====}
procedure TAlarmNotifyForm.FormShow(Sender: TObject); procedure TAlarmNotifyForm.FormShow(Sender: TObject);
begin begin
Self.Width := 410;
Self.Height := 210;
OpenItemBtn.SetFocus; OpenItemBtn.SetFocus;
end; end;

View File

@ -84,7 +84,8 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages,LCLProc,LCLType,LCLIntf, LMessages,LCLProc,LCLType,LCLIntf,
{$ELSE} {$ENDIF}
{$IFDEF WINDOWS}
Windows, Windows,
{$ENDIF} {$ENDIF}
Classes, Classes,
@ -109,7 +110,7 @@ type
protected protected
procedure DrawRotatedText (x, y : Integer; procedure DrawRotatedText (x, y : Integer;
Text : string; Text : Widestring;
Rotate : Boolean); Rotate : Boolean);
procedure Swap (var a, b : Integer); procedure Swap (var a, b : Integer);
@ -977,7 +978,7 @@ begin
end; end;
procedure TVpExCanvas.DrawRotatedText (x, y : Integer; procedure TVpExCanvas.DrawRotatedText (x, y : Integer;
Text : string; Text : Widestring;
Rotate : Boolean); Rotate : Boolean);
var var
@ -985,7 +986,6 @@ var
OldFont : TFont; OldFont : TFont;
RealPoint : TPoint; RealPoint : TPoint;
OldBrushStyle : TBrushStyle; OldBrushStyle : TBrushStyle;
begin begin
if not Assigned (FCanvas) then if not Assigned (FCanvas) then
raise EVpCanvasError.Create (RSNoCanvas); raise EVpCanvasError.Create (RSNoCanvas);
@ -1044,6 +1044,26 @@ begin
end; end;
end; end;
procedure DrawTextW(Canvas: TCanvas; lpString: PWideChar; var lpRect: TRect; uFormat: Cardinal;
AdjustRight: Boolean);
var Style:TTextStyle;
begin
{$ifndef WINCE}
{$ifdef UNIX}
{$ifdef LCLgtk}
Style.Layout:=tlCenter;
Canvas.TextRect(lpRect,lpRect.Left,lpRect.Top,lpString,Style); // theo 24.2.2007 Gibt sonst Striche auf GTK1
{$else}
DrawTextW(Canvas.Handle, lpString, Length(lpString), lpRect, uFormat, AdjustRight);
{$endif}
{$else}
Canvas.TextOut(lpRect.Left,lpRect.Top,lpString);
{$endif}
{$else}
Canvas.TextOut(lpRect.Left,lpRect.Top,lpString);
{$endif}
end;
function TVpExCanvas.ViewportWidth : Integer; function TVpExCanvas.ViewportWidth : Integer;
var var
FixRect : TRect; FixRect : TRect;

View File

@ -1305,13 +1305,12 @@ end;
{=====} {=====}
procedure TVpDayView.DoStartDrag(var DragObject: TDragObject); procedure TVpDayView.DoStartDrag(var DragObject: TDragObject);
begin begin exit;
DvDragStartTime := 0.0; DvDragStartTime := 0.0;
if ReadOnly then if ReadOnly then
Exit; Exit;
if FActiveEvent <> nil then begin if FActiveEvent <> nil then begin
{ Set the time from which this event was dragged } // Set the time from which this event was dragged
DvDragStartTime := trunc(Date + ActiveCol) DvDragStartTime := trunc(Date + ActiveCol)
+ dvLineMatrix[ActiveCol, ActiveRow].Time; + dvLineMatrix[ActiveCol, ActiveRow].Time;
@ -1324,7 +1323,7 @@ end;
{=====} {=====}
procedure TVpDayView.DoEndDrag(Target: TObject; X, Y: Integer); procedure TVpDayView.DoEndDrag(Target: TObject; X, Y: Integer);
begin begin exit;
if ReadOnly then if ReadOnly then
Exit; Exit;
TVpEventDragObject(Target).Free; TVpEventDragObject(Target).Free;
@ -1333,7 +1332,7 @@ end;
procedure TVpDayView.DragOver(Source: TObject; X, Y: Integer; State: TDragState; procedure TVpDayView.DragOver(Source: TObject; X, Y: Integer; State: TDragState;
var Accept: Boolean); var Accept: Boolean);
begin begin exit;
if ReadOnly then begin if ReadOnly then begin
Accept := False; Accept := False;
Exit; Exit;
@ -1355,7 +1354,7 @@ var
DragToTime : TDateTime; DragToTime : TDateTime;
i : Integer; i : Integer;
begin begin exit;
if ReadOnly then if ReadOnly then
Exit; Exit;
Event := TVpEventDragObject(Source).Event; Event := TVpEventDragObject(Source).Event;

View File

@ -184,8 +184,8 @@ begin
and (Screen.ActiveForm.FormStyle = fsStayOnTop) then and (Screen.ActiveForm.FormStyle = fsStayOnTop) then
Form.FormStyle := fsStayOnTop; Form.FormStyle := fsStayOnTop;
Form.Height := FPlacement.Height; // Form.Height := FPlacement.Height;
Form.Width := FPlacement.Width; // Form.Width := FPlacement.Width;
{set position} {set position}
case FPlacement.Position of case FPlacement.Position of