选择显示字体大小

在delphi中使用xml文档有两种方法

delphi中使用xml文档有两种方法,一是使用delphi 内置的xml broker;一是使用msxml.dll 。

一  使用xml broker, 是delphi 内置的

例:

unit showxml;

interface

uses classes httpapp db dbclient midas

xmlbrokr webcomp miditems;

type

tcustomshowxmlbutton = class(txmlbutton iscriptcomponent)

protected

xmlmethodname: string;

{ iscriptcomponent }

procedure addelements(addintf: iaddscriptelements);

function getsubcomponents: tobject;

{ iwebcontent implementation }

function implcontent(options: twebcontentoptions;

parentlayout: tlayout): string; override;

end;

tshowxmlbutton = class(tcustomshowxmlbutton)

public

constructor create(aowner: tcomponent); override;

published

property custom;

property style;

property stylerule;

property caption;

property xmlbroker;

property xmluseparent;

end;

tshowdeltabutton = class(tcustomshowxmlbutton)

public

constructor create(aowner: tcomponent); override;

published

property custom;

property style;

property stylerule;

property caption;

property xmlbroker;

property xmluseparent;

end;

implementation

uses sysutils midprod;

resourcestring

sshowxml = 'show xml';

sshowdelta = 'show delta';

procedure tcustomshowxmlbutton.addelements(

addintf: iaddscriptelements);

begin

addintf.addincludefile('xmlshow.js');

end;

function tcustomshowxmlbutton.getsubcomponents: tobject;

begin

result := nil;

end;

function tcustomshowxmlbutton.implcontent(options: twebcontentoptions;

parentlayout: tlayout): string;

var

attrs: string;

intf: ilayoutwebcontent;

formvarname: string;

rowsetvarname: string;

begin

addquotedattrib(attrs 'name' name);

addquotedattrib(attrs 'style' style);

addquotedattrib(attrs 'class' stylerule);

addquotedattrib(attrs 'value' self.caption);

addcustomattrib(attrs custom);

if assigned(xmldata.xmlbroker) then

begin

formvarname := xmldata.xmlbroker.submitformvarname;

rowsetvarname := xmldata.xmlbroker.rowsetvarname(nil); // row row set var name

end;

if not (conoscript in options.flags) then

result :=

format(''#13#10

[attrs rowsetvarname xmlmethodname sxmlreadyvar])

else

result :=

format(''#13#10

[attrs]);

if assigned(parentlayout) and parentlayout.getinterface(ilayoutwebcontent intf) then

result := intf.layoutbutton(result getlayoutattributes);

end;

{ tshowxmlbutton }

constructor tshowxmlbutton.create(aowner: tcomponent);

begin

inherited;

defaultcaption := sshowxml;

xmlmethodname := 'root';

end;

{ tshowdeltabutton }

constructor tshowdeltabutton.create(aowner: tcomponent);

begin

inherited;

defaultcaption := sshowdelta;

xmlmethodname := 'getdelta()';

end;



二  使用msxml.dll 

例:

....

procedure tdhedform.openbtnclick(sender: tobject);

var

pvin : olevariant;

prompt : olevariant;

begin

pvin := '';

prompt := true;

dhtmledit1.loaddocument(pvin prompt);

end;

procedure tdhedform.savebtnclick(sender: tobject);

var

vo vb : olevariant;

begin

vo := dhtmledit1.currentdocumentpath;

if (vo <> '') then

begin

vb := false;

end

else

begin

vo := '';

vb := true;

end;

dhtmledit1.savedocument(vo vb);

end;

procedure tdhedform.saveasclick(sender: tobject);

var

vo vb : olevariant;

begin

vo := '';

vb := true;

dhtmledit1.savedocument(vo vb);

end;

...


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons