怎麼呼叫XP Style的元件呢? |
答題得分者是:axsoft
|
lcsboy
版主 ![]() ![]() ![]() ![]() ![]() 發表:87 回覆:622 積分:394 註冊:2002-06-18 發送簡訊給我 |
|
axsoft
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
引言: 看到有人的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 ![]() ![]() ![]() ![]() |
axsoft
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
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 發送簡訊給我 |
MENU CONTEXTUEL STYLE XP![]() //*****Fichier .h*************** //--------------------------------------------------------------------------- #ifndef Unit1H #define Unit1H //--------------------------------------------------------------------------- #include網路志工聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]--- |
axsoft
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
VirtualTreeview![]() |
axsoft
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
Windows XP Theme Manager![]() |
axsoft
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
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 發送簡訊給我 |
TWinXP : Enabled Windows XP visual styles in applications最佳WinXP Style解決方案喔!完全Free喔!含Source Code喔 Version: 適用版本:![]() ![]() ![]() ![]() ![]() ![]() ![]() |
lcsboy
版主 ![]() ![]() ![]() ![]() ![]() 發表:87 回覆:622 積分:394 註冊:2002-06-18 發送簡訊給我 |
|
phototin
初階會員 ![]() ![]() 發表:13 回覆:30 積分:29 註冊:2002-06-15 發送簡訊給我 |
|
lcsboy
版主 ![]() ![]() ![]() ![]() ![]() 發表:87 回覆:622 積分:394 註冊:2002-06-18 發送簡訊給我 |
|
axsoft
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
引言: 對不起,我知道這問題很笨, 不過,我試了很久還是不會使用, 可否教我一下,謝謝。 我是用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 發送簡訊給我 |
|
axsoft
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
其實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 發送簡訊給我 |
引言: 把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 發送簡訊給我 |
|
lcsboy
版主 ![]() ![]() ![]() ![]() ![]() 發表:87 回覆:622 積分:394 註冊:2002-06-18 發送簡訊給我 |
|
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
|
lcsboy
版主 ![]() ![]() ![]() ![]() ![]() 發表:87 回覆:622 積分:394 註冊:2002-06-18 發送簡訊給我 |
|
lcsboy
版主 ![]() ![]() ![]() ![]() ![]() 發表:87 回覆:622 積分:394 註冊:2002-06-18 發送簡訊給我 |
|
axsoft
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
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 發送簡訊給我 |
|
lcsboy
版主 ![]() ![]() ![]() ![]() ![]() 發表:87 回覆:622 積分:394 註冊:2002-06-18 發送簡訊給我 |
|
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
|
axsoft
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
引言: 請問大家: 我是裝文魁出版的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 發送簡訊給我 |
引言: 請問大家: 我是裝文魁出版的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 發送簡訊給我 |
|
newbie
初階會員 ![]() ![]() 發表:81 回覆:45 積分:25 註冊:2002-11-28 發送簡訊給我 |
|
TTL
一般會員 ![]() ![]() 發表:4 回覆:17 積分:4 註冊:2004-01-30 發送簡訊給我 |
|
lcsboy
版主 ![]() ![]() ![]() ![]() ![]() 發表:87 回覆:622 積分:394 註冊:2002-06-18 發送簡訊給我 |
引言:引言: 對不起 還是不太懂... 如果我在 XP BCB5 的環境下 TWinXP or XP Theme Manager 那麼 compiled 好的程式丟到 2000 上是不是不會有 xp 的效果? :(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. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |