Wednesday, October 21, 2009

Help of DW MX 2004 API: Object piece

Introduce: Article English original is the Help/dwextend.chm below Dreamweaver installation catalog, by the steamed bread (Www.mantou001.com) interpreter is Chinese, in the process that translating to accord with the taste of our Chinese as far as possible, I consider the tunnel of the language above all, let a reader forget his as far as possible reading translated text, it is next make a reader can fluent understand, as to devoted to textual put in the 3rd, to take care of abecedarian, translator of a few terms still added explanatory note, translation copyright puts in a steamed bread 's charge all, reprint ask give chapter and verse for (Www.mantou001.com) . Those who break up is bad, please great give advice or comments.

How is inserting an object run?

Pass when the user insert face plate or pass menu make choice of an object, the process that carries out after this is as follows:

1.Dreamweaver calls CanInsertObject() function judgement to whether show a dialog box.

2. is opposite the meaning that "form"(searchs to express sheet in corresponding file, translator is noted) mark, if be put in "form" to label and if the dialog box shows, dreamweaver calls WindowDimensions() function judgement to set the size that expresses simple dialog box, if nonexistent "form" labels in corresponding file, dreamweaver does not show a dialog box, jump over measure 2.

3. if the Dreamweaver in the 1st pace showed a dialog box, the parameter that the user inputs this object (for instance the linage of form, the row counts) , click affirmatory.

4. calls ObjectTag() , the value that he returns is inserted after current position (if current make choice of character, will be not replaced) .

5. if Dreamweaver did not find ObjectTag() function, replace with InsertObject() function.

To the middle of inserting face plate add an object

The picture that an each object file is associated 18*18 gives those who go up to insert face plate now like element size.

If your image is more than 18*18, dreamweaver becomes automatic changeover 18*18, if you will use acquiescent image without image.

Point: Although object file can be deposited,be inside alone folder, but every file name must be exclusive! Because certain function is not in only,appoint the search inside Wen Jiaga. If have two files,call Button.htm for instance, dreamweaver cannot distinguish.

Define insert face plate

Through Configurations/Objects/insertbar.xml this file has the definition that inserts face plate, the definition information of every object was contained in this file.

Face plate is inserted to be in when user first time runs Dreamweaver editor division upper part, this face plate shows after this and the information such as the position when reality will be saved in registering a watch.

Below the format with respect to illustrate Insertbar.xml file:

< ? Xml Version="1.0" ? >
<insertbar>
<category Id="DW_Insertbar_Common" Folder="Common ">
<button Id="DW_TagDialog "Image="Objects/Common/tagDialog.gif "Enabled="true "ShowIf="_VIEW_CODE "Command="dw.getDocumentDOM().setView('code')"/>
<separator ShowIf="_VIEW_CODE"/>
<button Id="DW_BR "Image="Objects/Common/BR.gif "Enabled="true "File="Objects/Common/br.htm"/>
. . .
</category>
</insertbar>

Insert a few kinds of script that appear in face plate

◆ <insertbar></insertbar>
Action: File begin ending indicates.

◆ <category></category>
Action: Define page of a label (translator notes: The button that thrusts face plate to go up because of Dreamweaver is too much, because this is divided into " of a lot of " label page, for instance: Commonly used, the) such as text.

For example:
<category Id="DW_Insertbar_Text" Folder="Text">
Each label page has attribute Id an exclusive Id, than the DW_Insertbar_Common attribute of as above article. Folder deposits this label page the folder name of all pushbutton, than if the Common of above paragraphs is deposited,be in. Between <insertbar></insertbar> .

◆ <button>
Action: Define a pushbutton
For example:

<button Id="DW_mantou "Image="Common\mantou.gif "Enabled=" "ShowIf=" "File="Common\mantou.htm"/>

Each pushbutton has attribute Id an exclusive Id, than the DW_TagDialog of as above article.

The file name of the image of attribute Image pushbutton.

The file name of correspondence of attribute File pushbutton.

Deposit between <category></category> .

◆ <separator>
Action: Define column of switch of a condition (such saying very ambiguous, very fathomless, the Standard View in reading composing label page please and Layout View see effect) .

Deposit between <category></category> .

◆ <checkbutton>
Action: Define pushbutton of switch of a condition.
For example:

<separator ShowIf=""/>         
<checkbutton Id="DW_StandardView "Name = "Standard View "Image=" "Enabled="_VIEW_DESIGN "Checked=" ! _VIEW_LAYOUT "Command="dw.getDocumentDOM().setShowLayoutView(false)"/>
    
<checkbutton Id="DW_LayoutView "Name="Layout View "Image=" "Enabled="_VIEW_DESIGN "Checked="_VIEW_LAYOUT "Command="dw.getDocumentDOM().setShowLayoutView(true)"/>
        
<separator ShowIf=""/>

Each switch pushbutton has attribute Id an exclusive Id, for instance: DW_StandardView.

The name of attribute Name pushbutton (translator notes: Also be the clew) after the pushbutton that shows in Dreamweaer and mouse are put at the same time.

File of image of attribute Image pushbutton, image="" expresses literal pushbutton.

What attribute Enabled and Checked control other pushbutton jointly is usable grey perhaps drop.

Put between <separator ShowIf=""/><separator ShowIf=""/> .

No comments:

Post a Comment