~ubuntu-branches/ubuntu/precise/pcb/precise

« back to all changes in this revision

Viewing changes to doc/pcb.html/Resource-Syntax.html

  • Committer: Bazaar Package Importer
  • Author(s): Hamish Moffatt
  • Date: 2005-02-20 13:14:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050220131400-pfz66g5vhx0azl8f
Tags: 1.99j+20050127-2
* Improved package description: (closes: #295405)
* Fixed dependency: tk84 -> tk8.4 (closes: #295404)
* Updated README.debian (closes: #269578)
* Applied patch to src/djopt.c to allow compilation with gcc-4.0
  (closes: #294319), thanks to Andreas Jochens for the patch.
* Prevent example files from being compressed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html lang="en">
 
2
<head>
 
3
<title>Pcb</title>
 
4
<meta http-equiv="Content-Type" content="text/html">
 
5
<meta name="description" content="Pcb">
 
6
<meta name="generator" content="makeinfo 4.6">
 
7
<meta http-equiv="Content-Style-Type" content="text/css">
 
8
<style type="text/css"><!--
 
9
  pre.display { font-family:inherit }
 
10
  pre.format  { font-family:inherit }
 
11
  pre.smalldisplay { font-family:inherit; font-size:smaller }
 
12
  pre.smallformat  { font-family:inherit; font-size:smaller }
 
13
  pre.smallexample { font-size:smaller }
 
14
  pre.smalllisp    { font-size:smaller }
 
15
--></style>
 
16
</head>
 
17
<body>
 
18
<div class="node">
 
19
<p>
 
20
Node:&nbsp;<a name="Resource%20Syntax">Resource Syntax</a>,
 
21
Next:&nbsp;<a rel="next" accesskey="n" href="Menu-Definitions.html#Menu%20Definitions">Menu Definitions</a>,
 
22
Up:&nbsp;<a rel="up" accesskey="u" href="Custom-Menus.html#Custom%20Menus">Custom Menus</a>
 
23
<hr><br>
 
24
</div>
 
25
 
 
26
<h3 class="section">Resource Syntax</h3>
 
27
 
 
28
<p>A resource file is a simple text file.  It contains curly braces to
 
29
group things, spaces between things, and double quotes when strings
 
30
need to include spaces.  There are four fundamental ways of adding
 
31
data to a resource.
 
32
 
 
33
   <p>First, a string (either a single word or a quoted string with spaces,
 
34
we call both "strings" in this appendix) can be added all by itself,
 
35
to add a string resource to the current resource.  This is used, for
 
36
example, to define the string printed on a menu button.  In this
 
37
example, four strings are added to the <var>File</var> resource:
 
38
 
 
39
<pre class="example">     File = {
 
40
       Sample
 
41
       "longer sample"
 
42
       some text
 
43
     }
 
44
     </pre>
 
45
 
 
46
   <p>Second, a named string may be added by giving two strings separated by
 
47
an equals sign.  This is used to specify X resources and a few other
 
48
optional parameters of menus, for example.  Note that a string all by
 
49
itself is thus an "unnamed" string.
 
50
 
 
51
<pre class="example">     {"Layer groups" foreground=red sensitive=false}
 
52
     </pre>
 
53
 
 
54
   <p>Third, an unnamed subresource may be added.  This is used to create
 
55
submenus and menu buttons.  To add a subresource, simply group other
 
56
things in curly braces.  This example describes a resource containing
 
57
one string and three subresources:
 
58
 
 
59
<pre class="example">     {File
 
60
       {New do_new()}
 
61
       {Save do_save()}
 
62
       {Quit do_quit()}
 
63
     }
 
64
     </pre>
 
65
 
 
66
   <p>Lastly, a named subresource may be added by prefixing an unnamed
 
67
subresource with a string and an equals sign, just as when naming
 
68
strings.  This syntax is used to name the resources used for the main
 
69
menu and popup menus:
 
70
 
 
71
<pre class="example">     MainMenu = {
 
72
       ...
 
73
       }
 
74
     </pre>
 
75
 
 
76
   <p>Additionally, the menu parser allows for "hooks" whereby portions of
 
77
the menu system can be programmatically created at runtime by the
 
78
application.  These hooks are invoked by a single word proceeded by an
 
79
at sign, such as this example where most of the Sizes menu is created
 
80
automatically:
 
81
 
 
82
<pre class="example">     {Sizes
 
83
         @sizes
 
84
         {"Adjust active sizes ..." AdjustStyle(0)}
 
85
         }
 
86
     </pre>
 
87
 
 
88
   <p>In addition to all that, any unquoted pound sign (<code>#</code>) begins a
 
89
comment.  Commented text continues until the end of the containing
 
90
line.  Comments may begin at the beginning of a line, or after other
 
91
text on the line:
 
92
 
 
93
<pre class="example">     # This is a comment
 
94
     MainMenu = { # This is also a comment
 
95
     </pre>
 
96
 
 
97
   </body></html>
 
98