Embodiment
Typical computing environment
Fig. 1 shows the example that can realize suitable computingasystem environment 100 of the present invention therein.Computingasystem environment 100 is only as an example of suitable computing environment, and do not mean that any restriction is made in use of the present invention and function.Also computing environment 100 should be interpreted as combination to any one or they in the assembly shown in the typical operation environment 100 has and relies on or requirement.
The present invention can operate with a plurality of other universal or special computingasystem environment or structures.The example that is applicable to known calculations of the present invention system, environment and/or configuration includes but not limited to personal computer, server computer, hand-held or laptop devices, multicomputer system, the system based on microprocessor, set-top box, programmable consumer electronics, network PC, minicomputer, large scale computer, comprises distributed computing environment of said system and equipment combination in any or the like.
Can in environment, the present invention be described such as the computer executable instructions of the program module that can carry out by computing machine.Program module generally includes the execution particular task or realizes the routine of particular abstract, program, object, assembly, data structure or the like.The present invention also can put into practice in distributed environment, and wherein task is by carrying out via the teleprocessing equipment of communication network link.In distributed computing environment, program module can be positioned on the local and remote computer-readable storage medium that has comprised memory storage device.
Referring to Fig. 1, an example system that is used to realize method and apparatus of the present invention comprises the universal computing device of computing machine 110 forms.The assembly of computing machine 110 includes but not limited to: processing unit 120, system storage 130 and handle comprise that the various system components of system storage are coupled to the system bus 121 of processing unit 120.System bus 121 can be the bus structure of any kind, comprises any local bus of the bus architecture that memory bus or Memory Controller, peripheral bus and use are various.And unrestricted, these architectures comprise ISA(Industry Standard Architecture) bus, Micro Channel Architecture (MCA) bus, enhancement mode ISA (EISA) bus, VESA (VESA) local bus as an example.Peripheral component interconnect (pci) bus (being also referred to as the Mezzanine bus), peripheral parts interconnected straight-through (PCI-Express) and System Management Bus (SMBus).
Computing machine 110 generally includes a plurality of computer-readable mediums.Computer-readable medium can be any medium that can be visited by computing machine 110 and comprise volatibility with non-volatile medium, movably with immovable medium.The unrestricted method by example, computer-readable medium comprises computer-readable storage medium and communication media.Volatibility that computer-readable storage medium can be realized in any storage means or technology and non-volatile, removable and removable medium not are such as computer-readable instruction, data structure, program module or other data.Computer-readable storage medium includes but not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital universal disc (DVD) or other optical memory, magnetic holder, tape, disk storage device or other magnetic storage apparatus or can store expectation information also can be by any other medium of computing machine 110 visits.Telecommunication media specifically is expressed as computer-readable instruction, data structure, program module or usually such as other data in the modulated data-signal of carrier wave or other transfer mechanisms, and comprises any information transmitting medium.Term " modulated message signal " refers to the signal that has with the one or more features that in signal the mode of information coding are provided with or change.As an example and unrestricted, telecommunication media comprises such as cable network or direct wired media of connecting of line, and such as the wireless medium of acoustics, RF, infrared ray or other wireless mediums.Above-mentioned combination in any also is positioned at the scope of computer-readable medium.
System storage 130 comprises the computer-readable storage medium with volatibility and/or non-volatile form of memory, such as ROM 131 and RAM 132.Including the basic input/output (BIOS) 133 that helps such as each interelement transmits the basic routine of information in computing machine 110 between the starting period can be stored among the ROM 131.RAM 132 generally includes can be by the data and/or the program module of processing unit 120 zero accesses and/or current operation.And unrestricted, Fig. 1 shows operating system 134, application program 135, other program modules 136 and routine data 137 as an example.
Computing machine 110 can comprise that also other are removable/computer-readable storage medium of not removable, volatile, nonvolatile.Only as an example, Fig. 1 shows and is used for hard drive 140 that not removable, non-volatile magnetic medium is read and writes, is used for the disk drive 151 removable, that non-volatile magnetic disk 152 reads and writes and is used for disc drives 155 that removable, the non-volatile CD 156 such as CD-ROM or other optical mediums is read and writes.Also other that can in the operating environment of this example, use removable/computer-readable storage medium not removable, volatile, nonvolatile includes but not limited to tape cassete, flash card, digital universal disc, digital video band, solid-state RAM or the like.Hard drive 141 links to each other with system bus 121 by the not removable memory interface such as interface 140 usually, and disk drive 151 and CD drive 155 are connected with system bus 121 by the removable memory interface such as interface 150 usually.
Driving also shown in Figure 1 and relevant computer-readable storage medium provide computer-readable instruction, data structure, program module or other data for computing machine 110 storage more than is discussed.Hard drive 141 for example shown in Figure 1 is used for storage operating system 144, application program 145, other program modules 146 and routine data 147.Notice that these assemblies can be identical or different with storage operating system 134, application program 135, other program modules 136 and routine data 137.Operating system 144, application program 145, other program modules 146 and routine data 147 give different labels at this and show that they are different copies at least.The user can with by such as keyboard 162 and the input equipment that is commonly called the positioning equipment 161 of mouse, tracking ball or touch pad will be ordered and information is input to computing machine 20.Other input equipment (not shown) can comprise microphone, operating rod, game mat, satellite tv antenna, scanner or the like.The input equipment of these and other is connected with processing unit 120 via the user's input interface 160 that is coupled to system bus usually, but also can be connected with bus structure via other interfaces such as parallel interface, game interface or USB (universal serial bus) (USB).Monitor 191 or other types display device also can link to each other with system bus 121 via the interface such as video interface 190.Except monitor, computing machine also can comprise other the peripheral output devices such as loudspeaker 197 and printer 196 that connect via output peripheral interface 190.
Computing machine 110 can use logic such as the one or more remote computer of remote computer 180 and be connected operation in the network environment.Remote computer 180 can be personal computer, server, router, network PC, peer device or other common network node, and generally include many or whole elements that aforementioned calculation machine 110 relates to, though only show memory storage device 181 among Fig. 1.The logic connection that Fig. 1 describes comprises makes Local Area Network 171 and wide area network (WAN) 173, but also can comprise other networks.Such network environment is common in office's scope or company's range computation machine network, Intranet and the Internet.
When using in the lan network environment, computing machine 110 links to each other with LAN 171 by network interface or adapter 170.When using in the WAN network environment, computing machine 110 generally includes modulator-demodular unit 172 or other are used for to set up and WAN 173 communicating devices of passing through such as the Internet.Modulator-demodular unit 172 that can be internal or external links to each other with system bus 121 via user's input interface 160 or other suitable mechanism.In network environment, the described memory module that relates to computing machine 110 or its part can be stored in the remote memory storage device.And unrestricted, the remote application 185 shown in Fig. 1 is positioned on the memory devices 181 as an example.Be appreciated that the network connection that illustrates is exemplary and also can uses the additive method of setting up communication link between computing machine.
The exemplary embodiments that is used for the pattern of UI design
Modern user interface (UI) normally represents that by the group objects in the described UI attribute (for example color, position, textual value) of element (for example button, rectangle, window) and these elements is defined.The present invention realizes a kind of " pattern " as the arrangement of one group of attribute (including but not limited to pattern, position, geometry etc.) and these property values (for example green, screen is middle, ellipse etc.).Each pattern all has and is used for unique title or other identifiers that refers to itself, and these patterns can be applicable to the object in the described UI definition.For example, user interface design person can define two patterns, the pattern that wherein a kind of foreground and background colour are defined by black and white respectively is called as " zebra ", and another kind of foreground and background colour are defined by black respectively and orange pattern is called as Tiger.If " zebra " is applied to one group of button and list box, then they just present black and white, or this deviser can add Tiger to obtain black and orange theme.
Pattern definition mechanism of the present invention can be divided into two parts: use described pattern to define to influence " working time " assembly of UI sense organ and " design time " assembly that is defined the experience of this user interface sense organ by WYSIWYG instrument being used to of presenting.Can realize described design time according to described working time of object.
Working time styled objects
Styled objects is to have one group of property set through name that designated value is arranged.Described attribute can be from any class.The general mechanism that attribute is quoted in use can make that (CLR) and other objective systems can quote a kind of attribute by giving type name and attribute-name between the common language runtime.For example " Button.Background ", " Button " wherein are type name and " Background " is an attribute-name of the type.Described CLR is the part of the .NET Framework that can obtain from MICROSOFT CORP., the execution of supervisory routine simultaneously and be provided for sharing of public Object-Oriented class.
Given these, just can declare a kind of pattern with XML, for example:
<Style?Name=”MyStyle”Button.Background=”RGB(0,0,1,0)”
DockPanel.Dock=”Left”/>
If realize pattern-succession, then a kind of pattern just can be based on another kind of pattern.This just means that a kind of pattern can be selected any attribute from the parent pattern and/or numerical value is right.Attribute arrangement meeting has the priority consideration and b referred to as " replacement " that described parent is provided with in described novel type.For example:
<Style?Name=”BaseStyle”Button.Background=”RGB(0,0,1,0)”
Button.Foreground=”RGB(0,1,0,0)”/>
<Style?Name=”DerivedStyle”BasedOn=”BaseStyle”
Button.Background=”RGB(0,1,1,0)”Button.BorderColor=”RGB(0,1,1,1)”/>
A kind of pseudo-C# class definition of pattern can be as follows:
class?Style
{
public?string?Name{get;set;}
public?Dictionary<Property,object>Properties{get;}
public?Style?BasedOn{get;set;}
}
Each element all comprises the attribute that is called as pattern, and its value is exactly a kind of described ID of pattern.The described value of this attribute is the described pattern of this element.
<Button?Style=”ButtonStyle”.../>
Can be defined by any attribute type through name and resources shared.
<def:Resource?Name=”Blue”Value=”RGB(0,0,0,1)”/>
<def:Resource?Name=”SystemForeground”Value=”RGB(0,0,1,1)”/>
<Style?Name=”Foo”Background=”%Blue”
Foreground=”%SystemForeground”/>
Whether exist a local value to determine any attribute on the element by checking with pattern.If do not exist whatever, just use described property value from this element pattern.
Pattern can be become theme with resource organizations.Theme is one group of pattern definition can switching one group of content whole outward appearance easily.
<Theme>
<def:Resource?Name=”Blue”Value=”RGB(0,0,0,1)”/>
<def:Resource?Name=”SystemForeground”
Value=”RGB(0,0,1,1)”/>
<Style?Name=”BaseButtonStyle”.../>
<Style?Name=”SpinButtonStyle”BasedOn=”BaseButtonStyle”.../>
</Theme>
Local theme can be replaced existing pattern or expand described pattern group.The user just can select to change in an application program and be used for the default button background of all buttons like this, and need not to change the described Style Attributes of all these buttons.In addition preferably, all controls are all specified the Style Attributes of an acquiescence, and this attribute is one that knows in the style name.For example, described button classification can be defined as its default style " SystemButtonStyle ".
According to the present invention, above many variations all are feasible.Change according to first, can define the theme of any range.At this moment just can be introduced in the theme at any level place in the tree structure.Like this, theme just can be replaced these patterns and new pattern is introduced a panel or introduced button or the like.Second variation becomes identical thing to pattern with template definition.If template also can be provided with the attribute on its appended control, be a subclass of template only just at the pattern of this definition subsequently then.The 3rd variation is by the pattern of strong typing.Pattern can fall into association attributes group (being similar to QueryGroups).These association attributeses can be all text attribute, stroke property or the like.Control under this changes will have the attribute that separates that is used for each style type.This is to have imposed on these patterns very flexibly and with a useful structure.
In working time, thereby can use described style name to be applied to allow object that the object of one pattern tabulation is provided them to discern these patterns.For example
<Button?Style=”MyStyle;OtherStyle”/>
Actual property value on these objects is calculated by priority and is determined.At first use any attribute that is set directly on this object, the pattern of walking about in order subsequently tabulation and any attribute that application is not provided with as yet from current pattern.In above-mentioned example, can be applied in any attribute that is not set directly in the MyStyle on the described button like this, then can use any attribute of the OtherStyle that is not set directly on the described button or is not provided with by MyStyle subsequently.
In a word, given object O have pattern tabulation s1, s2, s3 ... .Sn}, just should use final attribute with following order:
Be arranged on any attribute on the O
Be arranged on the s1, and be not arranged on any attribute on the O
Be arranged on the s2, and be not arranged on any attribute on O or the s1
Be arranged on the sn, and be not arranged on O, s1, s2 ... any attribute on the sn-1
Forward Fig. 2 now to, what illustrate is process flow diagram by the process that assembly is carried out working time of the present invention.The process that is used for each object (" O ") begins at step 200 place.At step 202 place, use the Style Attributes that is arranged on the O.Select next pattern in step 204 subsequently.At step 206 place, be added from the next attribute that is associated with this pattern of described pattern.At step 208 place, determine whether this attribute is arranged on the O.If no, just this attribute is set subsequently, otherwise described process just proceeds to step 212 to determine whether also have any remaining attribute in described pattern at step 210 place.If like this, this process is just got back to step 206 subsequently, otherwise this process just advances to step 214, determines whether to also have any remaining pattern to be applied in therein.If like this, this process is just returned step 204 subsequently, otherwise this process just finishes at step 216 place.
According to the present invention, one group of user interface tool can show pattern tabulation by name, and allows this deviser to give their described attributes of expression attribute and value.In addition, these instruments provide pattern for the element of this UI.The modular design of this UI has been shown in Fig. 3 and Fig. 4.Assembly made described UI element select described attribute arrangement and allowed these elements maybe should be used for selecting new attribute by the definition that changes pattern and arranges working time.Also can allow multiple pattern is applied on the single object to expansion of the present invention, make color pattern and font style may be mixed together, and adopted the pattern of the Object Oriented OO notion of classification succession to inherit to allow re-using of management more simply and pattern.
Referring to Fig. 3 and Fig. 4, can use the exemplary dialog frame that illustrates therein to define pattern.Described UI allows directly to set a property on object.Use this UI, just alternative and extract attribute therefrom.The attribute of this extraction can be named as one style subsequently.One style can be employed and can this pattern be set by name by pointing to an object.As shown in Figure 3, selected button is just chosen its color attribute from " Blueberry " pattern.As shown in Figure 4, only will shown in pattern change into Metallic and just will change whole property set.
Like this, but the present invention just provide can with the simple tool mechanism of source resource model compatibility.Because can use XML to realize, so it can be by serialization and debugging easily.Though described the present invention, should be appreciated that and also can use other similar embodiment or also can make and revise and additionally do not deviate from them to carry out identical functions of the present invention to the embodiment that describes in conjunction with the preferred embodiment of each accompanying drawing.For example, those of ordinary skills should be realized that the present invention who describes in this manual can be applied to any wired or wireless computing equipment or environment, and can be applied to any amount of described computing equipment via communication network and with this network interaction.Should emphasize in addition, also can consider to comprise the various computer platforms of handheld device operating system and other application program assigned operation systems, particularly along with the surge of various Wireless Communication Equipment.In addition, also can in a plurality of process chip or equipment, realize the present invention, and can like a plurality of equipment class, influence memory storage.Therefore, the present invention should not be limited to any single embodiment, but should explain its width and scope according to claims.