全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:13217
推到 Plurk!
推到 Facebook!
[<<] [1] [>>]

怎麼呼叫XP Style的元件呢?

答題得分者是:axsoft
lcsboy
版主


發表:87
回覆:622
積分:394
註冊:2002-06-18

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-09-18 00:33:50 IP:210.85.xxx.xxx 未訂閱
看到有人的AP, 像Scroll Bar 可以叫出XP型式, 那種圓圓肥肥的, 好可愛呀 不知道誰會呼叫呢?
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#2 引用回覆 回覆 發表時間:2002-09-18 08:50:42 IP:61.218.xxx.xxx 未訂閱
引言: 看到有人的AP, 像Scroll Bar 可以叫出XP型式, 那種圓圓肥肥的, 好可愛呀 不知道誰會呼叫呢?
用TBX v1.9.8或 TBX v2.0.14這顆元件試試!(要花錢的) TBX V1.9.8 下載處TBX package version 1.9.8 plus compiled demo project TBX V1.9.8 下載處TBX package version 1.9.7 plus compiled demo project Description TBX is an add-on to Toolbar2000 components (Copyright © 1998-2002 Jordan Russell), a shareware set of components available at http://www.jrsoftware.org. Features TBX expands Toolbar2000 with the following new features: Support for native and WindowsXP themes; Customizable layout for toolbar items; Variation of font sizes; Multi-line captions; Combo and list boxes embedded in menus and toolbars; Color selectors; Dockable panels (similar to OfficeXP task panes); Page scrollers; Status bars; Screenshots Default theme Default theme (Windows XP) OfficeXP theme Stripes theme Support The discussion on TBX package as well as other Toolbar2000 extensions is hosted by Jordan Russel's news server at: jrsoftware.toolbar2000.thirdparty. Please, address general questions to the newsgroup. A bug report server for TBX and other projects is installed at bugdb.g32.org. Direct e-mail contacts: alex@g32.org. For information on Toolbar2000 components, visit http://www.jrsoftware.org 聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]---
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#3 引用回覆 回覆 發表時間:2002-09-18 09:05:20 IP:61.218.xxx.xxx 未訂閱
ActionBand ColorMap Creator ,Delphi (7-7) Complet     http://delphi.ktop.com.tw/topic.php?TOPIC_ID=21345    聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]---
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#4 引用回覆 回覆 發表時間:2002-09-18 09:10:46 IP:61.218.xxx.xxx 未訂閱

MENU CONTEXTUEL STYLE XP

BCB Source code下載
//*****Fichier .h***************
//---------------------------------------------------------------------------    #ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include 
#include 
#include 
#include <Forms.hpp>
#include 
#include 
//---------------------------------------------------------------------------
const AnsiString BLANK_LINE="-";    class TForm1 : public TForm
{
__published:
     TMainMenu *MainMenu1;
     TMenuItem *Example1;
     TMenuItem *MenuItemOne1;
     TMenuItem *MenuItemThree1;
     TMenuItem *MenuItemFour1;
     TMenuItem *MenuItemFive1;
     TMenuItem *MenuItemTen1;
     TImageList *ImageList1;
     TMenuItem *N1;
     TMenuItem *N2;
                TLabel *Label1;
                TLabel *Label2;
     void __fastcall Example1Click(TObject *Sender);
     void __fastcall Example1DrawItem(TObject *Sender, TCanvas *ACanvas,
                    TRect &ARect, bool Selected);
     void __fastcall FormCreate(TObject *Sender);    private:
     TColor MainMenuBackground;
     TColor MainMenuHighlightColor;
     TColor MainMenuTextColor;
     TColor MainMenuTextBackground;
     TColor MainMenuHighlightTextColor;
     TColor Custom;
     TColor VerticalColor;
     TColor MenuColor;
     TColor HighlightColor;
     TColor BorderColor;
     TColor NormalTextColor;
     TColor NormalTextBackground;
     TColor HighlightTextColor;
     TColor DisabledTextColor;
     int VerticalWidth;
     int FocusRectRightIndent;
     int FocusRectLeftIndent;
     int LeftTextPos;
     int SideBuffer;
     int MenuIncreaseWidth;
     int Offset;         int MenuItemHeight;
     int ItemOffset;
     TIcon *Icon;
     Graphics::TBitmap *Image;    protected:
     void __fastcall MyExpandItemWidth(TObject *Sender, TCanvas *ACanvas,
            int &Width, int &Height);
     void __fastcall MyDrawItem(TObject* Sender, TCanvas* ACanvas,
     const TRect &ARect, bool Selected);    public: 
     __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif    //*********Fichier .cpp*****************    #include 
#pragma hdrstop    #include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
     : TForm(Owner)
{
}
//---------------------------------------------------------------------------    void __fastcall TForm1::Example1DrawItem(TObject *Sender, TCanvas *ACanvas,
            TRect &ARect, bool Selected)
{
     TRect FocusRectBorder;
     TRect FocusRectFill;
     TMenuItem *MenuItem = ((TMenuItem*)Sender);         AnsiString Text = MenuItem->Caption;         ACanvas->Brush->Color = MainMenuBackground;
     ACanvas->FillRect(ARect);         if(Text == "")
            return;         if(Selected)
     {                FocusRectBorder = ARect;
            ACanvas->Brush->Color = BorderColor;
            ACanvas->FrameRect(FocusRectBorder);                FocusRectFill = ARect;
            FocusRectFill.Top  = SideBuffer;
            FocusRectFill.Right -= SideBuffer;
            FocusRectFill.Left  = SideBuffer;
            FocusRectFill.Bottom -= SideBuffer;
            ACanvas->Brush->Color = MainMenuHighlightColor;
            ACanvas->FillRect(FocusRectFill);             ACanvas->Font->Color = MainMenuHighlightTextColor;
     }
     else
     {
            ACanvas->Font->Color = MainMenuTextColor;
     }         int TextLength;
     TRect TextRect;         TextLength = Text.Length();
     TextRect = ARect;         TextRect.Left  = 5;
     TextRect.Top  = 1;         DrawText(ACanvas->Handle,Text.c_str(), TextLength, &TextRect, 0);    }
//---------------------------------------------------------------------------    void __fastcall TForm1::MyDrawItem(TObject* Sender, TCanvas* ACanvas,
     const TRect &ARect, bool Selected)
{
     int TopPos, TextLength;
     AnsiString Text;
     TRect TempRect;
     TRect VerticalRect;
     TRect FocusRectBorder;
     TRect FocusRectFill;
     TRect TextRect;         TMenuItem *MenuItem = ((TMenuItem*)Sender);         Text = MenuItem->Caption;         ACanvas->Brush->Color = MenuColor;
     ACanvas->FillRect(ARect);         if(Text==BLANK_LINE)
     {                VerticalRect = ARect;
            VerticalRect.Top -= SideBuffer;
            VerticalRect.Right = VerticalWidth;
            VerticalRect.Bottom  = SideBuffer;
            ACanvas->Brush->Color = VerticalColor;
            ACanvas->FillRect(VerticalRect);                ACanvas->MoveTo(VerticalWidth,ARect.Top ARect.Height()/2);
            ACanvas->LineTo(ARect.Right,ARect.Top ARect.Height()/2);
            return;
     }         TextLength = Text.Length();         if(Selected)
     {
            VerticalRect = ARect;
            VerticalRect.Top -= SideBuffer;
            VerticalRect.Right = VerticalWidth;
            VerticalRect.Bottom  = SideBuffer;
            ACanvas->Brush->Color = VerticalColor;
            ACanvas->FillRect(VerticalRect);                if(MenuItem->Enabled)
            {
                FocusRectBorder = ARect;
                 FocusRectBorder.Left  = FocusRectLeftIndent - SideBuffer;
                 FocusRectBorder.Right -= FocusRectRightIndent - SideBuffer;
                 ACanvas->Brush->Color = BorderColor;
                 ACanvas->FrameRect(FocusRectBorder);                     FocusRectFill = ARect;
                 FocusRectFill.Right -= FocusRectRightIndent;
                 FocusRectFill.Left  = FocusRectLeftIndent;
                 FocusRectFill.Bottom -= SideBuffer;
                 FocusRectFill.Top  = SideBuffer;
                 ACanvas->Brush->Color = HighlightColor;
                 ACanvas->FillRect(FocusRectFill);                     ACanvas->Font->Color = HighlightTextColor;
                 ACanvas->Font->Style = TFontStyles() << fsBold;
            }
            else
            {                     ACanvas->Font->Style = TFontStyles();
                 ACanvas->Brush->Color = NormalTextBackground;
                 ACanvas->Font->Color = DisabledTextColor;
            }         }
     else
     {                VerticalRect = ARect;
            VerticalRect.Top -= SideBuffer;
            VerticalRect.Right = VerticalWidth;
            VerticalRect.Bottom  = SideBuffer;
            ACanvas->Brush->Color = VerticalColor;
            ACanvas->FillRect(VerticalRect);                if(MenuItem->Enabled)
            {
                 ACanvas->Brush->Color = NormalTextBackground;
                 ACanvas->Font->Color = NormalTextColor;
            }
            else
            {
                 ACanvas->Brush->Color = NormalTextBackground;
                 ACanvas->Font->Color = DisabledTextColor;
            }         }         TextRect = ARect;
     TextRect.Left  = LeftTextPos;
     if(Offset > 0)
            TextRect.Top  = Offset/2   SideBuffer;
     else
            TextRect.Top  = 2   SideBuffer;         TextRect.Top  = SideBuffer;         if(Menu->Images != NULL)
     {
            Icon = new TIcon();
            Menu->Images->GetIcon(MenuItem->ImageIndex,Icon);
            ACanvas->Draw(5,ARect.Top ItemOffset 1,Icon);
            delete Icon;
     }         DrawText(ACanvas->Handle,Text.c_str(), TextLength, &TextRect, 0);
}
//---------------------------------------------------------------------------    void __fastcall TForm1::MyExpandItemWidth(TObject *Sender,
     TCanvas *ACanvas, int &Width, int &Height)
{
     Width  = MenuIncreaseWidth;
     Height  = Offset;
     MenuItemHeight = Height;
     ItemOffset = Offset/2;
}
//---------------------------------------------------------------------------    void __fastcall TForm1::FormCreate(TObject *Sender)
{
//**************couleur du highlight 
     Custom=TColor(RGB(255,200,200));
     MainMenuBackground = clSilver;
     MainMenuHighlightColor = Custom;
     MainMenuTextColor = clBlack;
     MainMenuTextBackground = clSilver;
     MainMenuHighlightTextColor = clBlack;
     VerticalColor = clSilver;
     MenuColor = clWhite;
     HighlightColor = Custom;
     BorderColor = clBlack;
     NormalTextColor = clBlack;
     NormalTextBackground = clWhite;
     HighlightTextColor = clBlack;
     DisabledTextColor = clSilver;
     VerticalWidth = 26;
     FocusRectRightIndent = 3;
     FocusRectLeftIndent = 3;
     LeftTextPos = 35;
     SideBuffer = 1;         if(Menu->Images == NULL)
            MenuIncreaseWidth = 100;
     else
            MenuIncreaseWidth = 50;         Offset = 5;
}
//---------------------------------------------------------------------------    void __fastcall TForm1::Example1Click(TObject *Sender)
{
     TMenuItem *MenuItem = ((TMenuItem*)Sender);
     if(MenuItem->Count > 0)
     {
            for(int i=0; i <= MenuItem->Count-1; i  )
            {
                 MenuItem->Items[i]->OnMeasureItem = MyExpandItemWidth;
                 MenuItem->Items[i]->OnDrawItem = MyDrawItem;
                 if(MenuItem->Items[i]->Count > 0)
                 {
                        for(int x=0; x <= MenuItem->Items[i]->Count-1; x  )
                        {
                             MenuItem->Items[i]->Items[x]->OnMeasureItem = MyExpandItemWidth;
                             MenuItem->Items[i]->Items[x]->OnDrawItem = MyDrawItem;
                        }
                 }
            }
     }
}
//---------------------------------------------------------------------------
聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]---
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#5 引用回覆 回覆 發表時間:2002-09-18 09:35:23 IP:61.218.xxx.xxx 未訂閱

VirtualTreeview

資料來源:http://www.delphi-gems.com/VirtualTreeview/VT.php Virtual Treeview is a treeview control built from ground up. More than 3 years of development made it one of the most flexible and advanced tree controls available today. Virtual Treeview starts off with the claim to improve many aspects of exisiting solutions and introduces some new technologies and priniciples which were not available before. As the name already indicates, this control uses a different paradigm for tree management than other controls of this kind. It does not know anything about the data it manages (except its size), not even the captions of a node. Everything is retrieved from the application via events (or descentants via overridden methods). Virtual Treeview has been carefully designed and thoroughly tested. The control proved its concept as well as everyday fitness already in many commercial products and freeware projects. Note: Virtual Treeview needs Windows XP Theme Manager to compile, if you have Delphi 6 or lower or Borland C Builder 6 or lower! Since Delphi 7 Delphi Gems Themes Services are integral part of the VCL, so you don''t need the Theme Manager. 下載: Virtual Treeview Main distribution Virtual Treeview source only Borland C Builder Package 其他詳細內容及下載請見網站http://www.delphi-gems.com/VirtualTreeview/VT.php 聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2002/10/21 18:00:24
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#6 引用回覆 回覆 發表時間:2002-09-18 09:43:21 IP:61.218.xxx.xxx 未訂閱

Windows XP Theme Manager

資料來源:http://www.delphi-gems.com/ThemeManager.php Windows XP Theme Manager Manager is a suite of three classes which enable access to Windows XP theme support from Delphi and Borland C Builder applications. TThemeServices is a wrapper around the themes APIs and allows an application or control to use theme functions without worrying about managing theme data and listen to theme changes in the system. It has a very small memory footprint and does not appear on the component palette. TThemeManager is a component that takes important measures to allow VCL applications to work with Windows XP themes and modifies some controls to match the general theme look. It does not need to modify any VCL units nor to change code in an application. It is indeed a drop-and-forget component. Internally a TThemeServices instance is used for painting, which is also exposed as property, so an application does not need to create an own one if it needs to paint theme elements. TThemeManagerDB is the third class in the bundle and is an enhanced TThemeManager class which takes care for DB controls. It is located in an own unit because it has to import database units which are not of general interest in all applications. Downloads: Windows XP Theme Manager Version: 1.9.6 Last change: 15. Sep 2002 Downloads: 11722 Size: 335 KB Author: Mike Lischke (www.delphi-gems.com) Windows XP Theme Explorer Version: n/a Last change: 30. Jun 2002 Downloads: 4457 Size: 971 KB Author: Mike Lischke (www.delphi-gems.com) Windows XP System Button Version: 1.0 Last change: 10. Jun 2002 Downloads: 4100 Size: 334 KB Author: Mike Reith (www.tetzel.com/CocoR) Windows XP Theme Manager help Version: n/a Last change: 04. Aug 2002 Downloads: 3132 Size: 218 KB Author: Mike Lischke (www.delphi-gems.com) Overview: A XML manifest resource is not automatically included in the application. In order to avoid problems by controls, which use the themes units, you must either add a manifest file (YourAppName.exe.manifest) to the application folder or compile your application with the WinXP.res resource file. You will find both, the resource file as well as a manifest file (which can be used for any application, just rename it accordingly) in the Theme Explorer folder. The themes DLL is dynamically loaded to avoid breaking applications on older Windows systems. The entire theme management is done by the TThemeServices class. This includes awareness for theme changes as well as opening and closing theme data. A, as I think, more logical identification for the many theme parts and states is used, which makes usage much more intuitive. Various VCL controls are subclassed by TThemeManager, either to provide a bug fix or to fix the painting in general. The theme manager is aware of control additions and removals and does the subclassing transparently. The list of subclassed controls includes: TListView, The bug in report mode without images in the header had to be fixed. TAnimate, The background of the (transparent) animation window must be fixed (see also topic Known issues). TButtonControl, This includes TButton, TBitBtn, T(Custom)CheckBox and TRadioButton. TBitBtn must be fully drawn by the manager, while check boxes, radio buttons and TButtons must be made transparent. TCustomGroupBox, Necessary to subclass because it must be fully drawn by the manager (transparency, rounded border, themed caption). TTabSheet, The tab sheet background must be painted using the parent's background instead of the own one (simulation of transparency). Additionally, its non-client area must be painted in a theme fashion if the border size is > 0. TTrackBar, Also the trackbar must be made transparent. TStatusBar, The status bar has a gradient background which is drawn by the Theme Manager. Additionally, it needs repaints on resize to avoid size grip smearing and wrong text output. TSpeedButton, This control, which is very similar to TButton and TBitBtn is not a normal Windows control, so it has fully to be painted by the theme manager. TCustomPanel, If a panel has the same color as its parent control, then it is painted transparently too. TCustomFrame, Frames are always painted transparently because this serves their purpose much better. TDBLookupComboBox, The lookup combobox needs a themed border and drop down button. TCustomStaticText, The static text control is a normal window control and its background must be made transparent. TCheckListBox, The check list box control has own paint routines for the check boxes, which must be now drawn in themed style. TWinControl, If a window control is not already in one of the other list then it is separately subclassed to have its border painted in themed fashion (e.g. to fix wrong borders of TScrollBox and TRichEdit). Additionally, TScrollBox's background is painted transparently here. Three additional fixes are required, which don't need subclassing: TLabel should be transparent to show correct background. TToolBar should be transparent as well to show correct background. TToolButton uses csCaptureMouse in its control style which prevents proper working on Windows XP. Hence this style must be removed. Also here is a known problem. 相關下載請見:http://www.delphi-gems.com/ThemeManager.php 聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2002/10/21 18:01:28
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#7 引用回覆 回覆 發表時間:2002-09-18 10:05:54 IP:61.218.xxx.xxx 未訂閱

Microsoft ComCtrls and Delphi/C Builder version 6

- by Eddie Churchill 資料來源 http://community.borland.com/article/0,1410,28423% Abstract:Eddie Churchill describes the pitched battle to maintain compatibility with the XP version of ComCtrls, and also discusses Themes by Eddie Churchill, RAD group R&D 2C00.html The ongoing ComCtrls battle (Also known as "Here we go again") The compatibility battle between Delphi/C Builder and Microsoft® ComCtrls (and its Image List) has been going on for years. For each new release of ComCtrls we have had to rework our support for it and ComCtrls v6 is no different. In fact this new version of ComCtrls is even a bigger leap for everybody. Microsoft knew this was going to be the case and went out of their way to prevent an application from accidentally using it. Alas, it is possible for the user to tell the OS to make an application use the new version without the application having any say in the matter, which can produce strange results. Those results can range from simple cosmetic changes all the way to data corruption. There are a number of ways to support the new version of ComCtrls. We are still researching the best route to take, but most of them will result in "interface" changes which cannot be done in an inline update. Thus we have opted to wait until the next major release (Delphi/C Builder v7.0) to support ComCtrls v6. What does ComCtrls v6 do? First, ComCtrls v6 requires Windows XP or better. It doesn't run on anything else. Period. It completely reworks how controls are implemented and behave, not just the traditional ComCtrls controls (TListView, TTreeView, etc) but also those that used to live in User32 (TButton, TEdit, etc). And while the new ComCtrls introduces a few new control types, its real claim to fame is Themes. Themes are all the rage so to speak (or were a while back, things have calmed down a bit on that front). With it you can "change" the look of your application without recompiling, even your users can do it. Well ... "change" is a strong word. Theming engines have traditionally affected controls by adjusting how controls look (by changing their rendering and in turn possibly size) and possibly where they appear. The latter is not implemented by ComCtrls, but who knows even that might appear in the future. This brings us back to controlling how a control looks. If ComCtrls only changed how controls render that would be one thing but that change may affect the size of the control. The size changing issue mostly shows up in the window border. Themes can make your window's client real estate smaller or bigger than when it was originally designed. If your application isn't prepared to deal with this its forms might look a little amateurish or "cheesy". Judicious use the alignment and anchor properties can fix most of those problems for you. But what about the actual render of the controls? Most controls automatically render or theme correctly. VCL is for the most part a thin veneer over the controls in User32 and ComCtrls. Alas there are times when it does its own custom render. Mostly this is related to the render of the background of the control. VCL tend to render backgrounds as a solid opaque instead of the theme's background pattern. VCL will need to call the theming engine to render those cases when using the new version ComCtrls. We are currently planning to attack this problem at the custom control level and most of the descendent classes will simply inherit this new behavior. There are a few cases where the actual foreground render of a control will have to be adjusted (TSpeedButton for example) and those too will have to render through the theming engine. Which brings us to custom controls; those are controls that in part or whole perform custom rendering. If your control simply descends from a standard control and does something logically different but leaves the render alone then you should not have any problem. But if you do your own render then themes will be something that you have to deal with. We currently plan to wrap the theming engine used by ComCtrls and that wrapping will be available to your custom control render code. We'll have more details on this wrapper for you, after we figure out what exactly it is or needs to be. So I don't have to worry about it right now, right? This is one of those good news/bad news things. First the good news: your application won't automatically get ComCtrls v6 just because it runs on Windows XP. In fact you have to go out of your way to get it. To do so you have to add a manifest to your application. A manifest is simply a XML snippet that tells the library loader to load a specific version of a library. The manifest can be added via a resource or as a file. The file will always trump the attached resource. Alas here comes the bad news (with ComCtrls there is always bad news): the user can add a manifest without your knowledge. Did you mention data corruption? As some of you know there is more to ComCtrls than simply controls. There is the Image List. Much has been written about the Image List, most of it not good. It would take more prose than I care to write to fully describe our history with Image List. It gives me the heebie-jeebies just thinking about it. So I will just limit this to what is different with ComCtrls v6. With this new version of ComCtrls a new Image List format has been introduced. This new format supports a number of image formats that the older format simply could not be extended to support. The library methods that we normally call will not generate a stream that is compatible with the older libraries. This means if the IDE (or your application for that matter) is manifested, and uses the new ComCtrls, it will generate Image List instance streams (for example DFMs) that cannot be read by older versions of ComCtrls. Microsoft has provided a set of new functions that will read and write the older stream format but for some reason they choose to not make them the default. We have two options that we are currently researching; first we could simply call those new functions or we could come up with our own format that is a bit more portable. Neither is really all that appealing but sometimes that is the way things are. So in conclusion... We are planning to support the new ComCtrls in the next major release. Until then please don't add a manifest to Delphi or C Builder itself or it will start using the new ComCtrls and in turn start writing out Image List streams that are wholly incompatible with anything except Windows XP's ComCtrls v6. You will regret it, trust me. But I want themes support now! Darn it! If you want to experiment with themes until then, there are a number of third party solutions that you can use right now. They can be classified in two groups: those built on top of Windows XP theming system and those that are not. Obviously if you want your application to be themeable on something other than just Windows XP, I would recommend the latter group. The following list is not meant to be exhaustive and my apologies to anyone I forgot to list. You can include yourself by commenting on this article. Windows XP solutions Windows XP Theme Manager, Mike Lischke 聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2002/09/18 10:14:48
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#8 引用回覆 回覆 發表時間:2002-10-02 09:50:47 IP:61.218.xxx.xxx 未訂閱

TWinXP : Enabled Windows XP visual styles in applications

最佳WinXP Style解決方案喔!完全Free喔!含Source Code喔 Version: 適用版本: 下載:TWinXP v1.0 Notes: Borland COMCTRLS wrapper for the TListView control has a problem with Windows XP visual styles on Windows XP. The only solution so far is to patch COMCTRLS if you want to use the Windows XP visual styles with listview controls. We can provide this patch upon email request when needed. ********************************************************************** Author: TMS Software Copyright ?2001 E-mail: info@tmssoftware.com Web: http://www.tmssoftware.com ********************************************************************** Delphi 3.0/4.0/5.0/6.0 & C Builder 3.0/4.0/5.0 Files : ----- winxp.zip : component files for Delphi 3,4,5,6 & C Builder 3,4,5 Release 1.0 : ------------- Gives your Delphi or C Builder applications the new visual look of Windows XP on a Windows XP machine. Feature Revision history : ------------------------ 1/8/2001 : first release Installation : -------------- In Delphi 3,4,5,6 or C Builder 3,4,5 Unzip files winxp.zip - Install into new package (or existing package) - Browse for (new) package file - Add winxp.pas Usage : ------- This component is freeware. Help, hints, tips, bug reports : ------------------------------ Send any remarks to : help@tmssoftware.com Please clearly state which Delphi or C Builder version you are using and which version of the component you are using. In case of doubt, download the latest version first at http://www.tmssoftware.com 聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2002/10/02 09:52:47
lcsboy
版主


發表:87
回覆:622
積分:394
註冊:2002-06-18

發送簡訊給我
#9 引用回覆 回覆 發表時間:2002-10-02 10:01:57 IP:210.63.xxx.xxx 未訂閱
最感動的是: 如果你一個project含很多個Form, 可能又還有FindDialog, ColorDialog, SaveDialog....etc. 你只要放一個TWinXP 就........通通有這樣的效果....... 真是..................太好用了 而且, WinXP下Complie過後, 拿去別的OS, 頂多恢復原狀, 也不會發生什麼 error! Borland要打屁屁了
phototin
初階會員


發表:13
回覆:30
積分:29
註冊:2002-06-15

發送簡訊給我
#10 引用回覆 回覆 發表時間:2002-10-03 03:18:05 IP:61.216.xxx.xxx 未訂閱
對不起,我知道這問題很笨, 不過,我試了很久還是不會使用, 可否教我一下,謝謝。 我是用C Builder。
lcsboy
版主


發表:87
回覆:622
積分:394
註冊:2002-06-18

發送簡訊給我
#11 引用回覆 回覆 發表時間:2002-10-03 09:58:18 IP:210.63.xxx.xxx 未訂閱
把TWinXP的元件, 擺一個在你的Form上面 Complier完就會出現結果, 但是: 1. 你一定要在WinXP下的環境 Complier 2. 目前試出ListView->ViewStyle=vsReport 會出槌 (我還不知怎麼解)
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#12 引用回覆 回覆 發表時間:2002-10-03 10:20:28 IP:61.218.xxx.xxx 未訂閱
引言: 對不起,我知道這問題很笨, 不過,我試了很久還是不會使用, 可否教我一下,謝謝。 我是用C Builder。
1.下載該元件
2.安裝TWinXP元件
  2.1.0 開啟新的Packag檔,加入winxp.pas後,點選Install即可
3.開啟新的Project
4.將TWinXP放置Form上後Commpiler
5.先決條件您的作業系統需為Windows XP
以上尚未在C Builder 6.0 上安裝過 聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]---
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#13 引用回覆 回覆 發表時間:2002-10-03 10:26:40 IP:61.218.xxx.xxx 未訂閱
引言: 把TWinXP的元件, 擺一個在你的Form上面 Complier完就會出現結果, 但是: 1. 你一定要在WinXP下的環境 Complier 2. 目前試出ListView->ViewStyle=vsReport 會出槌 (我還不知怎麼解)
喔!.....你沒看這個>> >> <>網<>路志<>工聯盟---- href="http://www.vista.org.tw">http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]---
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#14 引用回覆 回覆 發表時間:2002-10-03 11:39:32 IP:61.218.xxx.xxx 未訂閱
其實winxp這個元件也沒什麼特殊之處,只是在這個Resource *.RES檔裡加了這一段XML,有興趣的人可以用UltraEdit去開WinXP.RES這個檔案就能瞭解了    資料來源:http://community.borland.com/article/0,1410,28011,00.html    The following applies only if you run your application in Windows XP environnement. The procedure below was tested in Delphi 6.    Step 1:    Load your project, myproj.dpr    Step 2:    Create a xml file "myproj.exe.manifest" containing the following lines:    < ?xml version="1.0" encoding="UTF-8" standalone="yes"? > < assembly > < assemblyIdentity version="1.0.0.0" processorArchitecture="X86"  name="CompanyName.ProductName.YourApp"  type="win32"  / >  < description >My XP App.< /description > < dependency >  < dependentAssembly >  < assemblyIdentity  type="win32"  name="Microsoft.Windows.Common-Controls"  version="6.0.0.0"  processorArchitecture="X86"  publicKeyToken="6595b64144ccf1df"  language="*"  / >  < /dependentAssembly >  < /dependency >  < /assembly >"    Step 3:    Create a rc file "xp.rc" containing:    CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "myproj.exe.manifest"    Step 4:    Add the rc file to your project    Step 5:    Rebuild and run your application. Look at the buttons, comboboxes, lists, etc.     以下是WinXP.pas的源碼,版權為TMS公司所有    
{*************************************************************************}
{ TWinXP component                                                        }
{ for Delphi 4.0,5.0,6.0   C  Builder 3.0,4.0,5.0                         }
{ version 1.0                                                             }
{                                                                         }
{ written by TMS Software                                                 }
{            copyright © 2001                                             }
{            Email : info@tmssoftware.com                                 }
{            Website : http://www.tmssoftware.com/                        }
{                                                                         }
{ The source code is given as is. The author is not responsible           }
{ for any possible damage done due to the use of this code.               }
{ The component can be freely used in any application. The complete       }
{ source code remains property of the author and may not be distributed,  }
{ published, given or sold in any form as such. No parts of the source    }
{ code can be included in any other component or application without      }
{ written authorization of the author.                                    }
{*************************************************************************}    unit WinXP;    interface    {$R WINXP.RES}    uses
  Windows, Messages, SysUtils, Classes, Forms;    type
  TWinXP = class(TComponent)
  private
    { Private declarations }
  protected
    { Protected declarations }
  public
    { Public declarations }
    constructor Create(AOwner: TComponent); override;
  published
    { Published declarations }
  end;    procedure Register;    implementation    procedure Register;
begin
  RegisterComponents('TMS', [TWinXP]);
end;    { TWinXP }    constructor TWinXP.Create(AOwner: TComponent);
var
  I,Instances:Integer;    begin
  inherited Create(AOwner);
  if not (AOwner is TForm) then
    raise Exception.Create('Control parent must be a form!');      Instances := 0;
  for I := 0 to Owner.ComponentCount - 1 do
    if (Owner.Components[I] is TWinXP) then Inc(Instances);
  if (Instances > 1) then
    raise Exception.Create('Only one instance of TWinXP allowed on form');
end;        end.
 
聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2002/10/03 11:42:44
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#15 引用回覆 回覆 發表時間:2002-10-03 16:10:58 IP:61.218.xxx.xxx 未訂閱
引言: 把TWinXP的元件, 擺一個在你的Form上面 Complier完就會出現結果, 但是: 1. 你一定要在WinXP下的環境 Complier 2. 目前試出ListView->ViewStyle=vsReport 會出槌 (我還不知怎麼解)
以下是TMS的回信: Subject: RE: TListView has error after using TWinXP Included below is the requested patch for COMCTRLS.PAS:

procedure TCustomListView.UpdateColumn(AnIndex: Integer);
const IAlignment: array[Boolean, TAlignment] of LongInt =
  ((LVCFMT_LEFT, LVCFMT_RIGHT, LVCFMT_CENTER),
    (LVCFMT_RIGHT, LVCFMT_LEFT, LVCFMT_CENTER));
var
  Column: TLVColumn;
  AAlignment: TAlignment;
begin
  if HandleAllocated then
    with Column, Columns.Items[AnIndex] do
    begin
      mask := LVCF_TEXT or LVCF_FMT or LVCF_IMAGE;
      iImage := FImageIndex;
      pszText := PChar(Caption);
      AAlignment := Alignment;
      if Index <> 0 then
        fmt := IAlignment[UseRightToLeftAlignment, AAlignment]
      else fmt := LVCFMT_LEFT;
// start patch
{if FImageIndex <> -1 then
fmt := fmt or LVCFMT_IMAGE or LVCFMT_COL_HAS_IMAGES;}
      if FImageIndex <> -1 then
        fmt := fmt or LVCFMT_IMAGE or LVCFMT_COL_HAS_IMAGES
      else
        mask := mask and not (LVCF_IMAGE);
// end patch
      if WidthType > ColumnTextWidth then
      begin
        mask := mask or LVCF_WIDTH;
        cx := FWidth;
        ListView_SetColumn(Handle, Columns[AnIndex].FOrderTag, Column);
      end
      else begin
        ListView_SetColumn(Handle, Columns[AnIndex].FOrderTag, Column);
        if ViewStyle = vsList then
          ListView_SetColumnWidth(Handle, -1, WidthType)
        else if (ViewStyle = vsReport) and not OwnerData then
          ListView_SetColumnWidth(Handle, Columns[AnIndex].FOrderTag, WidthType);
      end;
    end;
end;    
Kind regards, Bruno Fierens TMS software team Email: info@tmssoftware.com Web: http://www.tmssoftware.com 聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2002/10/03 16:21:33
phototin
初階會員


發表:13
回覆:30
積分:29
註冊:2002-06-15

發送簡訊給我
#16 引用回覆 回覆 發表時間:2002-10-04 01:17:17 IP:61.216.xxx.xxx 未訂閱
謝謝指教, 我試過了delphi 5.0 和 c builder 6.0, 確定c builder 6.0是沒有辦法使用的!
lcsboy
版主


發表:87
回覆:622
積分:394
註冊:2002-06-18

發送簡訊給我
#17 引用回覆 回覆 發表時間:2002-10-07 10:44:03 IP:210.63.xxx.xxx 未訂閱
BCB 5.0是真的可以用這個物件叫出WinXP Style 但是對於ListView, ViewStyle=vsReport會出現嚴重error 經過修改VCL後, 還是會出現 不知那位大大可以修正這個OS的Bug呢?
taishyang
站務副站長


發表:377
回覆:5490
積分:4563
註冊:2002-10-08

發送簡訊給我
#18 引用回覆 回覆 發表時間:2002-10-08 09:33:57 IP:140.135.xxx.xxx 未訂閱
還有問題ㄝ... 就是StatusBar編譯完成後就不見了... 應該是bug吧...
lcsboy
版主


發表:87
回覆:622
積分:394
註冊:2002-06-18

發送簡訊給我
#19 引用回覆 回覆 發表時間:2002-10-08 14:01:19 IP:210.63.xxx.xxx 未訂閱
我寫的AP裡面就有StatusBar, 沒什麼問題說. BCB 5.0 WinXP
lcsboy
版主


發表:87
回覆:622
積分:394
註冊:2002-06-18

發送簡訊給我
#20 引用回覆 回覆 發表時間:2002-10-23 21:56:29 IP:210.85.xxx.xxx 未訂閱
Total solution!    http://delphi.ktop.com.tw/topic.php?TOPIC_ID=22298    但是也太total了..........居然XPTheme會讓code size爆增100K 我只要修正 > 誰叫我..... >
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#21 引用回覆 回覆 發表時間:2002-11-06 14:44:04 IP:61.218.xxx.xxx 未訂閱
BCB6已有解決方法,但BCB5上未突破.    方法請參考:    http://delphi.ktop.com.tw/topic.php?TOPIC_ID=21927    聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]---
kynix
初階會員


發表:37
回覆:100
積分:37
註冊:2002-06-01

發送簡訊給我
#22 引用回覆 回覆 發表時間:2002-11-06 21:45:48 IP:61.216.xxx.xxx 未訂閱
我想請問一下,有辦法在別的作業系統仍然顯示xp型式樣子的元件嗎? 我是用過大部分的元件,不是要錢就是多error
------
智慧是命運的征服者
lcsboy
版主


發表:87
回覆:622
積分:394
註冊:2002-06-18

發送簡訊給我
#23 引用回覆 回覆 發表時間:2002-11-06 23:15:03 IP:210.85.xxx.xxx 未訂閱
XP Style元件, 只是打開MS的WinXP XML功能, 讓你的AP變成WinXP Style! 所以這是OS所Control的功能, 只是把功能打開而已!    如果不是WinXP 或Win.Net是秀不出來的!    除非你自己要寫個像ActiveSkin的東東, 還能寫出和WinXP所有元件一模一樣 那還真是厲害呀 再次清楚的說明!
taishyang
站務副站長


發表:377
回覆:5490
積分:4563
註冊:2002-10-08

發送簡訊給我
#24 引用回覆 回覆 發表時間:2002-12-01 22:02:52 IP:140.135.xxx.xxx 未訂閱
請問大家: 我是裝文魁出版的C Builder與RS232上的控制元件 又安裝了TWinXP : Enabled Windows XP visual styles in applications 編譯時卻出現了Access violation at adderss 400039FD in module'VCL50.BPL'與EAccess Violation的錯誤訊息 是哪邊出了問題??該如何解決呢?? 謝謝大家...
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#25 引用回覆 回覆 發表時間:2002-12-02 09:06:31 IP:61.218.xxx.xxx 未訂閱
引言: 請問大家: 我是裝文魁出版的C Builder與RS232上的控制元件 又安裝了TWinXP : Enabled Windows XP visual styles in applications 編譯時卻出現了Access violation at adderss 400039FD in module'VCL50.BPL'與EAccess Violation的錯誤訊息 是哪邊出了問題??該如何解決呢?? 謝謝大家...
請先將TWinXP從你的專案中移除,然後編譯看看,會不會出現上述的問題,如果問題相同,請檢查您的專案中問題是出在哪,也可試著開一個新的專案檔,放入Rs-232元件(不作任何設定),編譯看看,看看會不會出現相同的問題....以此類推,你應該可以很快的找出問題所在 聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]---
lcsboy
版主


發表:87
回覆:622
積分:394
註冊:2002-06-18

發送簡訊給我
#26 引用回覆 回覆 發表時間:2002-12-02 10:07:30 IP:211.23.xxx.xxx 未訂閱
引言: 請問大家: 我是裝文魁出版的C Builder與RS232上的控制元件 又安裝了TWinXP : Enabled Windows XP visual styles in applications 編譯時卻出現了Access violation at adderss 400039FD in module'VCL50.BPL'與EAccess Violation的錯誤訊息 是哪邊出了問題??該如何解決呢?? 謝謝大家...
1. 不加TWinXP 看能不能Complie, 如果不能! 你們家的BCB不是有問題 就是RS232的VCL沒裝好! 2. 如果已經裝了TWinXP的話, 我的建議是, 先把*.obj砍了, 然後弄成 獨立執行檔, 這樣子去Complie試試
taishyang
站務副站長


發表:377
回覆:5490
積分:4563
註冊:2002-10-08

發送簡訊給我
#27 引用回覆 回覆 發表時間:2002-12-02 23:28:52 IP:140.135.xxx.xxx 未訂閱
謝謝板主們的幫助: TWinxp或RS-232都可以單獨編譯... 但倘若要放在一起的話則會發生我說的問題,我已經找到解決的方式了 就是編譯成到其他沒有BCB的電腦都可以執行的執行檔的方式就可以了 謝謝大家
newbie
初階會員


發表:81
回覆:45
積分:25
註冊:2002-11-28

發送簡訊給我
#28 引用回覆 回覆 發表時間:2004-02-11 17:55:42 IP:203.69.xxx.xxx 未訂閱
對不起    還是不太懂...    如果我在 XP +BCB5 的環境下+ TWinXP or XP Theme Manager    那麼 compiled 好的程式丟到 2000 上是不是不會有 xp 的效果?    :( 
TTL
一般會員


發表:4
回覆:17
積分:4
註冊:2004-01-30

發送簡訊給我
#29 引用回覆 回覆 發表時間:2004-02-11 22:54:51 IP:203.187.xxx.xxx 未訂閱
引言: 對不起 還是不太懂... 如果我在 XP BCB5 的環境下 TWinXP or XP Theme Manager 那麼 compiled 好的程式丟到 2000 上是不是不會有 xp 的效果? :( < face="Verdana, Arial, Helvetica">winxp & winnet 才有其效果...WIN2000應該是沒有吧....如有說錯請指正...
lcsboy
版主


發表:87
回覆:622
積分:394
註冊:2002-06-18

發送簡訊給我
#30 引用回覆 回覆 發表時間:2004-02-12 08:28:10 IP:211.22.xxx.xxx 未訂閱
引言:
引言: 對不起 還是不太懂... 如果我在 XP BCB5 的環境下 TWinXP or XP Theme Manager 那麼 compiled 好的程式丟到 2000 上是不是不會有 xp 的效果? :( < face="Verdana, Arial, Helvetica">winxp & winnet 才有其效果...WIN2000應該是沒有吧....如有說錯請指正...
XML是Windows XP之後的OS開始support, Windows 2000並不support. 而XP Style就是架構在Windows XP之後的OS. 所以, Windows 3.1/95/98/ME/NT/2000 都不support 列出目前support的OS Windows XP home Windows XP Professional Windows XP Media Center Windows 2003 server Windows Longhorn 目前的Microsoft並沒有出一套OS叫Winnet的東東. 以上如有錯誤, 請向
[<<] [1] [>>]
系統時間:2024-11-23 19:38:15
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!