TSpTBXDockablePanel + TsiLang

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

TSpTBXDockablePanel + TsiLang

Post by sysdba »

Hi,

When trying to assign chinese characters to a TSPTBXDockablePanel using Tsilang (With font="Arial Unicode MS" and Charset="CHINESEBIG5_CHARSET"), question marks are dispayed instead of the chinese characters.

I have seen that TSpTBXDockablePanel use TTntControls :

Code: Select all

TntControls.pas Unit :

procedure TTntCustomHintWindow.SetCaption(const Value: TWideCaption);
begin
  TntControl_SetText(Self, Value);
end;

procedure TntControl_SetText(Control: TControl; const Text: WideString);
begin

  if (not Win32PlatformIsUnicode)
  or ((Control is TWinControl) and TWinControl(Control).HandleAllocated and (not IsWindowUnicode(TWinControl(Control).Handle))) then
    // Win9x / non-unicode handle
    TAccessControl(Control).Text := Text
  else if (not (Control is TWinControl)) then begin
    // non-windowed TControl
    with FindWideControlHelper(Control) do
      SetSyncedWideString(Text, FWideCaption, TAccessControl(Control).Text, SetAnsiText);
  end else if (not TWinControl(Control).HandleAllocated) then begin
    // NO HANDLE
    TntControl_SetStoredText(Control, Text);
  end else if TntControl_GetText(Control) <> Text then begin
    // UNICODE & HANDLE
    Tnt_SetWindowTextW(TWinControl(Control).Handle, PWideChar(Text));
    Control.Perform(CM_TEXTCHANGED, 0, 0);
  end;
end;
Where is the problem ?

Thanks
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

You need to debug and verify that Text parameter on entering to procedure TntControl_SetText(Control: TControl; const Text: WideString);
is actually WideString for Chinese.
It is 90% that it was converted to Ansi somehwere before.
Best regards,
Igor Siticov.
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

Sample

Post by sysdba »

I have sent a sample to SpTBX team.

You can see this sample at this url :

http://dl-1.free.fr/52616e646f6d4956a02 ... ePanel.zip


Best regards
--------------
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

The URL is invalid :(
You can send it to us as well and we will test.
Best regards,
Igor Siticov.
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

Sample

Post by sysdba »

I have sent you the sample.
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

There are definitely some units used in uses clause (I can suggest that this is SUISkin) that damages drawing of Chinese. You can detect which unit exactly by removing them one-by-one from uses clause.
I've modified your sample (see http://www.sicomponents.com/soft/demos/ ... ePanel.zip) and it works just fine.
Best regards,
Igor Siticov.
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

Sample modified

Post by sysdba »

- When launching the new sample modified, Panels Captions are empty...
(You have set DefaultTitleBar to False)...
- I can't see the modifications outside Delphi since a message indicate me that the version of Tsilang you have used to compiled the application run only under delphi IDE.
- In Which uses clause SUISkin is used ?

Thanks

[/list]
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

1. I don't have DefaultTitleBar property on my version of TSpTBXDockablePanel and when launching EXE the panel captions are not empty, they are empty under design time only. What version do you use? We're using version 1.1 from 18 October 2005.

2. Sorry, just re-build it under your IDE. I forgot to use registered version to build a sample. I've updated the demo on our side, so you can re-download it.

3. From you source:

Code: Select all

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxGraphics, Menus, cxLookAndFeelPainters, ExtCtrls, TntStdCtrls,
  bsSkinBoxCtrls, bsSkinCtrls, cxMemo, cxTextEdit, cxButtons, cxButtonEdit,
  cxFontNameComboBox, SUIComboBox, SUIFontComboBox, SpTBXDkPanels,
  cxDropDownEdit, cxColorComboBox, TBXDkPanels, StdCtrls, SUITabControl,
  SUIPageControl, Grids, BaseGrid, AdvGrid, TntDbCtrls, Buttons,
  TntButtons, TntExtCtrls, Mask, DBCtrls, cxControls, cxContainer, cxEdit,
  cxMaskEdit, cxSpinEdit, TntLXLookupCtrls, TB2Item, TBX, SpTBXItem,
  TB2Toolbar, TB2Dock,TBXThemes,TBXAthenTheme, cxStyles, cxCustomData,
  cxFilter, cxData, cxDataStorage, DB, cxDBData, cxImage, cxLabel,
  cxBlobEdit, cxDBExtLookupComboBox, ComCtrls, TntComCtrls, VirtualTrees,
  cxCalendar, cxTreeView, cxGridTableView, cxGridDBTableView, AdvCombo,
  Lucombo, cxGridLevel, cxGridCustomTableView, cxGridCardView,
  cxGridDBCardView, cxClasses, cxGridCustomView, cxGrid, siComp,Tntforms;

type 
Best regards,
Igor Siticov.
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

Post by sysdba »

I have deleted all the units in the uses clause (like you).
and the problem i sstill the same
perahps because i use SpTBXLib 0.9...
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

As you can see (from my example) with version 1.1 it works quite good. So may be you need to upgrade to the latest version of SPTBX?
Best regards,
Igor Siticov.
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

Installation of TSpTBXLib 1.1

Post by sysdba »

I am trying to install SpTBXLib 1.1 but it's very boring because i have to install corrects versions of TB2K,TBX and patch...
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

SpTBX 1.1 Installed

Post by sysdba »

I have installed SPTBX 1.1 and now, indeed, everything is OK.
TSpTBXDockablePanels display correctly their title.

Thanks
Post Reply