Changeset 12 for ProtocolBuffers
- Timestamp:
- Oct 20, 2009, 11:31:33 AM (15 years ago)
- Location:
- ProtocolBuffers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ProtocolBuffers/Demo.lpi
r11 r12 9 9 <Icon Value="0"/> 10 10 <UseXPManifest Value="True"/> 11 <ActiveEditorIndexAtStart Value=" 2"/>11 <ActiveEditorIndexAtStart Value="0"/> 12 12 </General> 13 13 <VersionInfo> … … 38 38 <IsPartOfProject Value="True"/> 39 39 <UnitName Value="Demo"/> 40 <CursorPos X=" 23" Y="11"/>40 <CursorPos X="44" Y="16"/> 41 41 <TopLine Value="1"/> 42 <UsageCount Value="41"/> 42 <EditorIndex Value="3"/> 43 <UsageCount Value="42"/> 44 <Loaded Value="True"/> 43 45 </Unit0> 44 46 <Unit1> … … 48 50 <ResourceBaseClass Value="Form"/> 49 51 <UnitName Value="UMainForm"/> 50 <CursorPos X=" 1" Y="186"/>51 <TopLine Value="1 54"/>52 <CursorPos X="42" Y="159"/> 53 <TopLine Value="146"/> 52 54 <EditorIndex Value="0"/> 53 <UsageCount Value="4 1"/>55 <UsageCount Value="42"/> 54 56 <Loaded Value="True"/> 55 57 </Unit1> … … 58 60 <IsPartOfProject Value="True"/> 59 61 <UnitName Value="UProtocolBuffers"/> 60 <CursorPos X=" 43" Y="165"/>61 <TopLine Value=" 146"/>62 <CursorPos X="1" Y="247"/> 63 <TopLine Value="230"/> 62 64 <EditorIndex Value="2"/> 63 <UsageCount Value="4 1"/>65 <UsageCount Value="42"/> 64 66 <Loaded Value="True"/> 65 67 </Unit2> … … 70 72 <CursorPos X="3" Y="60"/> 71 73 <TopLine Value="27"/> 72 <EditorIndex Value=" 5"/>73 <UsageCount Value="4 1"/>74 <EditorIndex Value="6"/> 75 <UsageCount Value="42"/> 74 76 <Loaded Value="True"/> 75 77 </Unit3> … … 85 87 <CursorPos X="20" Y="4"/> 86 88 <TopLine Value="1"/> 87 <EditorIndex Value=" 7"/>88 <UsageCount Value=" 39"/>89 <EditorIndex Value="8"/> 90 <UsageCount Value="40"/> 89 91 <Loaded Value="True"/> 90 92 <SyntaxHighlighter Value="None"/> … … 96 98 <CursorPos X="1" Y="12"/> 97 99 <TopLine Value="1"/> 98 <EditorIndex Value=" 6"/>99 <UsageCount Value="3 8"/>100 <EditorIndex Value="7"/> 101 <UsageCount Value="39"/> 100 102 <Loaded Value="True"/> 101 103 </Unit6> … … 109 111 <Unit8> 110 112 <Filename Value="..\..\..\Programy\Lazarus_0.9.27\lcl\include\treeview.inc"/> 111 <CursorPos X=" 41" Y="3711"/>112 <TopLine Value="3 702"/>113 <CursorPos X="1" Y="3714"/> 114 <TopLine Value="3697"/> 113 115 <EditorIndex Value="1"/> 114 116 <UsageCount Value="12"/> … … 125 127 <CursorPos X="21" Y="160"/> 126 128 <TopLine Value="144"/> 127 <EditorIndex Value=" 4"/>129 <EditorIndex Value="5"/> 128 130 <UsageCount Value="15"/> 129 131 <Loaded Value="True"/> … … 140 142 <CursorPos X="19" Y="1"/> 141 143 <TopLine Value="1"/> 142 <EditorIndex Value=" 3"/>143 <UsageCount Value="2 7"/>144 <EditorIndex Value="4"/> 145 <UsageCount Value="28"/> 144 146 <Loaded Value="True"/> 145 147 <SyntaxHighlighter Value="None"/> … … 148 150 <JumpHistory Count="30" HistoryIndex="29"> 149 151 <Position1> 150 <Filename Value="U ProtocolBuffers.pas"/>151 <Caret Line="2 16" Column="1" TopLine="199"/>152 <Filename Value="UMainForm.pas"/> 153 <Caret Line="263" Column="1" TopLine="246"/> 152 154 </Position1> 153 155 <Position2> 154 <Filename Value="U ProtocolBuffers.pas"/>155 <Caret Line="2 19" Column="1" TopLine="202"/>156 <Filename Value="UMainForm.pas"/> 157 <Caret Line="267" Column="1" TopLine="250"/> 156 158 </Position2> 157 159 <Position3> 158 <Filename Value="U ProtocolBuffers.pas"/>159 <Caret Line="2 21" Column="1" TopLine="204"/>160 <Filename Value="UMainForm.pas"/> 161 <Caret Line="271" Column="1" TopLine="253"/> 160 162 </Position3> 161 163 <Position4> 162 <Filename Value="U ProtocolBuffers.pas"/>163 <Caret Line="2 22" Column="1" TopLine="205"/>164 <Filename Value="UMainForm.pas"/> 165 <Caret Line="273" Column="1" TopLine="253"/> 164 166 </Position4> 165 167 <Position5> 166 <Filename Value="U ProtocolBuffers.pas"/>167 <Caret Line="2 23" Column="1" TopLine="206"/>168 <Filename Value="UMainForm.pas"/> 169 <Caret Line="261" Column="1" TopLine="244"/> 168 170 </Position5> 169 171 <Position6> 170 <Filename Value="U ProtocolBuffers.pas"/>171 <Caret Line="2 24" Column="1" TopLine="207"/>172 <Filename Value="UMainForm.pas"/> 173 <Caret Line="262" Column="1" TopLine="245"/> 172 174 </Position6> 173 175 <Position7> 174 <Filename Value="U ProtocolBuffers.pas"/>175 <Caret Line="2 25" Column="1" TopLine="208"/>176 <Filename Value="UMainForm.pas"/> 177 <Caret Line="263" Column="1" TopLine="246"/> 176 178 </Position7> 177 179 <Position8> 178 <Filename Value="U ProtocolBuffers.pas"/>179 <Caret Line="2 26" Column="1" TopLine="209"/>180 <Filename Value="UMainForm.pas"/> 181 <Caret Line="264" Column="1" TopLine="247"/> 180 182 </Position8> 181 183 <Position9> 182 <Filename Value="U ProtocolBuffers.pas"/>183 <Caret Line="2 29" Column="1" TopLine="212"/>184 <Filename Value="UMainForm.pas"/> 185 <Caret Line="265" Column="1" TopLine="248"/> 184 186 </Position9> 185 187 <Position10> 186 <Filename Value="U ProtocolBuffers.pas"/>187 <Caret Line="23 3" Column="1" TopLine="216"/>188 <Filename Value="UMainForm.pas"/> 189 <Caret Line="235" Column="1" TopLine="218"/> 188 190 </Position10> 189 191 <Position11> 190 <Filename Value="U ProtocolBuffers.pas"/>191 <Caret Line="23 4" Column="1" TopLine="217"/>192 <Filename Value="UMainForm.pas"/> 193 <Caret Line="236" Column="1" TopLine="219"/> 192 194 </Position11> 193 195 <Position12> 194 <Filename Value="U ProtocolBuffers.pas"/>195 <Caret Line="2 35" Column="1" TopLine="218"/>196 <Filename Value="UMainForm.pas"/> 197 <Caret Line="245" Column="38" TopLine="229"/> 196 198 </Position12> 197 199 <Position13> 198 <Filename Value="U ProtocolBuffers.pas"/>199 <Caret Line="2 42" Column="1" TopLine="225"/>200 <Filename Value="UMainForm.pas"/> 201 <Caret Line="259" Column="1" TopLine="242"/> 200 202 </Position13> 201 203 <Position14> 202 204 <Filename Value="UMainForm.pas"/> 203 <Caret Line=" 173" Column="21" TopLine="161"/>205 <Caret Line="235" Column="1" TopLine="218"/> 204 206 </Position14> 205 207 <Position15> 206 <Filename Value="U ProtocolBuffers.pas"/>207 <Caret Line="2 22" Column="5" TopLine="212"/>208 <Filename Value="UMainForm.pas"/> 209 <Caret Line="236" Column="1" TopLine="219"/> 208 210 </Position15> 209 211 <Position16> 210 <Filename Value="U ProtocolBuffers.pas"/>211 <Caret Line=" 168" Column="42" TopLine="151"/>212 <Filename Value="UMainForm.pas"/> 213 <Caret Line="238" Column="1" TopLine="221"/> 212 214 </Position16> 213 215 <Position17> 214 <Filename Value="U ProtocolBuffers.pas"/>215 <Caret Line=" 172" Column="64" TopLine="151"/>216 <Filename Value="UMainForm.pas"/> 217 <Caret Line="239" Column="1" TopLine="222"/> 216 218 </Position17> 217 219 <Position18> 218 <Filename Value="U ProtocolBuffers.pas"/>219 <Caret Line=" 171" Column="40" TopLine="155"/>220 <Filename Value="UMainForm.pas"/> 221 <Caret Line="241" Column="1" TopLine="224"/> 220 222 </Position18> 221 223 <Position19> 222 224 <Filename Value="UMainForm.pas"/> 223 <Caret Line=" 186" Column="1" TopLine="169"/>225 <Caret Line="252" Column="1" TopLine="235"/> 224 226 </Position19> 225 227 <Position20> 226 <Filename Value="U ProtocolBuffers.pas"/>227 <Caret Line=" 158" Column="3" TopLine="153"/>228 <Filename Value="UMainForm.pas"/> 229 <Caret Line="261" Column="1" TopLine="244"/> 228 230 </Position20> 229 231 <Position21> 230 <Filename Value="U ProtocolBuffers.pas"/>231 <Caret Line="1 62" Column="1" TopLine="151"/>232 <Filename Value="UMainForm.pas"/> 233 <Caret Line="192" Column="1" TopLine="175"/> 232 234 </Position21> 233 235 <Position22> 234 236 <Filename Value="UProtocolBuffers.pas"/> 235 <Caret Line=" 163" Column="1" TopLine="146"/>237 <Caret Line="247" Column="1" TopLine="230"/> 236 238 </Position22> 237 239 <Position23> 238 <Filename Value="U ProtocolBuffers.pas"/>239 <Caret Line=" 166" Column="1" TopLine="149"/>240 <Filename Value="UMainForm.pas"/> 241 <Caret Line="235" Column="1" TopLine="218"/> 240 242 </Position23> 241 243 <Position24> 242 <Filename Value="U ProtocolBuffers.pas"/>243 <Caret Line=" 167" Column="1" TopLine="150"/>244 <Filename Value="UMainForm.pas"/> 245 <Caret Line="236" Column="1" TopLine="219"/> 244 246 </Position24> 245 247 <Position25> 246 <Filename Value="U ProtocolBuffers.pas"/>247 <Caret Line=" 168" Column="1" TopLine="151"/>248 <Filename Value="UMainForm.pas"/> 249 <Caret Line="238" Column="1" TopLine="221"/> 248 250 </Position25> 249 251 <Position26> 250 <Filename Value="U ProtocolBuffers.pas"/>251 <Caret Line=" 163" Column="1" TopLine="146"/>252 <Filename Value="UMainForm.pas"/> 253 <Caret Line="239" Column="1" TopLine="222"/> 252 254 </Position26> 253 255 <Position27> 254 <Filename Value="U ProtocolBuffers.pas"/>255 <Caret Line=" 166" Column="1" TopLine="149"/>256 <Filename Value="UMainForm.pas"/> 257 <Caret Line="241" Column="1" TopLine="224"/> 256 258 </Position27> 257 259 <Position28> 258 <Filename Value="U ProtocolBuffers.pas"/>259 <Caret Line=" 170" Column="1" TopLine="153"/>260 <Filename Value="UMainForm.pas"/> 261 <Caret Line="252" Column="1" TopLine="235"/> 260 262 </Position28> 261 263 <Position29> 262 <Filename Value="U ProtocolBuffers.pas"/>263 <Caret Line=" 171" Column="1" TopLine="154"/>264 <Filename Value="UMainForm.pas"/> 265 <Caret Line="261" Column="1" TopLine="244"/> 264 266 </Position29> 265 267 <Position30> 266 <Filename Value="U ProtocolBuffers.pas"/>267 <Caret Line="1 72" Column="1" TopLine="155"/>268 <Filename Value="UMainForm.pas"/> 269 <Caret Line="127" Column="42" TopLine="112"/> 268 270 </Position30> 269 271 </JumpHistory> -
ProtocolBuffers/UMainForm.pas
r11 r12 94 94 Tag := 2; 95 95 ItemType := itString; 96 ItemMode := im Optional;96 ItemMode := imRepeated; 97 97 end; 98 98 Items.Add(NewItem); … … 128 128 TPBStringItem(TPBMessageItem(PB.BaseMessage.Items[3]). 129 129 Items[0]).Value := 'Vsetínská'; 130 // TPBStringItem(PB.BaseMessage.Items[1]).Value := 'Abc'; 131 with TPBRepeatedItem(PB.BaseMessage.Items[1]) do begin 132 Items.Add(nil); 133 Items.Add(nil); 134 Clear(TPBDefinition(Definition.Items[1])); 135 TPBStringItem(Items[0]).Value := 'Test'; 136 TPBStringItem(Items[1]).Value := 'Hops'; 137 end; 138 130 139 DisplayTree(PB, TreeView1); 131 140 SaveToStream(Stream); … … 154 163 Tag := 2; 155 164 ItemType := itString; 165 //ItemMode := imRepeated; 156 166 DefaultString := 'Billy Joe'; 157 167 end; … … 227 237 NewNode: TTreeNode; 228 238 begin 229 for I := 0 to Definition.Items.Count - 1 do230 with TPBDefinition(Definition)do begin239 for I := 0 to PBRepeated.Items.Count - 1 do 240 with Definition do begin 231 241 NewNode := Node.Owner.AddChild(Node, ''); 232 242 if ItemType = itString then begin -
ProtocolBuffers/UProtocolBuffers.pas
r11 r12 245 245 246 246 if ItemMode = imRepeated then begin 247 TPBRepeatedItem( Items[ItemIndex]).Items.Add(NewItem);247 TPBRepeatedItem(Self.Items[ItemIndex]).Items.Add(NewItem); 248 248 end else begin 249 249 TPBItem(Self.Items[ItemIndex]).Assign(NewItem); … … 490 490 I: Integer; 491 491 begin 492 for I := 0 to Items.Count - 1 do 492 for I := 0 to Items.Count - 1 do begin 493 493 TPBItem(Items[I]).Free; 494 if Definition.ItemType = itInteger then begin 495 Items[I] := TPBIntegerItem.Create; 496 TPBIntegerItem(Items[I]).Value := Definition.DefaultInteger; 497 end else 498 if Definition.ItemType = itString then begin 499 Items[I] := TPBStringItem.Create; 500 TPBStringItem(Items[I]).Value := Definition.DefaultString; 501 end else 502 if Definition.ItemType = itMessage then begin 503 Items[I] := TPBMessageItem.Create; 504 TPBMessageItem(Items[I]).Clear(Definition); 505 end; 506 end; 494 507 inherited; 495 508 end;
Note:
See TracChangeset
for help on using the changeset viewer.