EnglishРусский  

   ..

   btnsys.g

   funcs.g

   gena.g

   gfe.g

   visedit.g

   viseditor.gi

   winedit.g

The project is closed! You can look at a new scripting language. It is available on GitHub.
Also, try our open source cross-platform automation software.

Ads

Installer and installation software
Commercial and Freeware installers.

  1 #charoem = 1
  2 #include = %EXEPATH%\lib\stdlib.ge
  3 #libdir = %EXEPATH%\lib
  4 #libdir1 = %EXEPATH%\..\lib\vis
  5 #silent = 1
  6 #output = %EXEPATH%\visedit.exe
  7 #exe=1 d g
  8 //#asm=1
  9 //#!gentee.exe -f -p exe "%1"
 10 //#wait=1
 11 
 12 
 13 type mytype
 14 {  
 15 //uint prop
 16 }
 17 
 18 
 19 property uint mytype.prop
 20 {
 21    return 0
 22 }
 23 
 24 method uint mytype.x
 25 {
 26    uint z = this.prop
 27    this.prop
 28    //100~~100
 29    //xxx   
 30    return 0
 31 }
 32 
 33 
 34 /*property zz.y( uint x, y, s)
 35 {
 36 }*/
 37 
 38 /*method zz.y( uint x )
 39 {
 40 }*/
 41 /*
 42 func test<main>
 43 {
 44    zz x
 45    uint p
 46    //p = &x
 47    //x.y
 48  //x.y  
 49    p = &x.y+1
 50    getch()
 51      
 52 }*/
 53 
 54 include {
 55    "..\\..\\lib\\ini\\ini.g"
 56 //   "..\\stdlib\\stdlib.ge"
 57 //   "test1.g"
 58 }
 59 func z
 60 {
 61    min(10,1)
 62 }
 63 
 64 
 65 define {
 66    DESIGNING = 1
 67 }
 68 ifdef !$DESIGNING 
 69 {
 70    sss
 71  //  $aaaaaaa
 72 }
 73 define {   
 74    COMP = 0
 75 }
 76 
 77 include {
 78 //   "..\\stdlib\\stdlib.g" 
 79    //"events.g"    
 80    "app.g"
 81    "images.g"   
 82    "btn.g"
 83    "panel.g"
 84    "scrollbox.g"
 85    "edit.g"
 86    "menu.g"
 87    "popupmenu.g"
 88    "treeview.g"
 89    "listview.g"
 90    "tab.g"
 91    "combobox.g"   
 92    "dialogs.g"
 93    "label.g"
 94    "labeled.g"
 95    "picture.g"
 96    "url.g"
 97    "btnpic.g"
 98    "tray.g"
 99    "splitter.g"
100    "toolbar.g"
101    "header.g"
102    "datetimepick.g"
103    "progressbar.g"
104    
105    "dlgbtns.g"
106    
107    "btnsys.g"
108    "winedit.g"
109    "proplist.g"   
110    //"..\\gt\\gt.g"
111 }
112 
113 
114 ifdef $DESIGNING {
115    include { 
116    "design_menu.g"
117    "design_tab.g" 
118    }   
119 }
120 
121 global {
122    uint mi0
123    uint mi1
124    uint ed1
125    uint ed2
126    uint pm
127    uint tt
128    uint cbb
129 }
130 
131 type project 
132 {
133    str filename
134    str runfile
135    str resources
136 }
137 
138 type myform <inherit=vForm>
139 {
140    project   prj   
141    //str srcfile
142    vPropList props  
143    vPropList events
144 
145    vMenu MainMenu 
146 
147    vTreeView objtv    //Список компонентов для добавления
148    vEdit     edcurcomp //Текущий выбранный элемент
149    
150    uint   edform
151    //vPropList x
152    //vBtn btArrow
153    uint curaddcomp //Тип выбранного объекта для добавления
154    vOpenSaveDialog dlgOpen
155    uint   desform  //Дополнительное окно редактирования
156    
157    str      gffile      //Содержимое gf файла
158    str      filename    //Имя файла для сохранения
159    filetime ftgf        //Время изменения gf файла
160    uint     flgsaved    //Файлы были сохранены
161    uint     flgchanged  //Были изменения
162    uint     flggfchanged //Были изменения в gf файле
163    str      curdir //текущая директория
164    //vMenuDesign md
165    //vLabel  Label
166    vVEPanel VEPanel
167    
168    uint     CurCompEdit //Текущее окно дополнительного редактирования 
169    
170 }
171 
172 method myform myform.init( )
173 {
174    return this
175 }
176 
177 include 
178 {
179    "main_save.g"
180 }
181 
182 //Установка нового значения свойства
183 method myform.propset <alias=propset>( evparProp ev )
184 {    
185    .flgchanged = 1
186    cm.GetCompDescr( .VEPanel.Selected.TypeId ).FindProp( ev.name.str() ).SetVal( .VEPanel.Selected, ev.value )
187    if ev.name.str() == "Name"
188    {
189       .GFSetHeaderf()
190    }
191    //.VEPanel.WE.green()
192    //.VEPanel.WE.select( .VEPanel.WE.winn->vCtrl )
193    //.VEPanel.Selected = .VEPanel.Selected
194    .VEPanel.Selected = .VEPanel.Selected   
195    .VEPanel.Virtual( $mDesChanged, .VEPanel.Selected )   
196 }
197 
198 method myform.eventset <alias=eventset>( evparProp ev )
199 {
200    .flgchanged = 1
201    uint event as cm.GetCompDescr( .VEPanel.Selected.TypeId ).FindEvent( ev.name.str() )
202    str  oldval = event.GetVal( .VEPanel.Selected ) 
203    
204    uint resset = event.SetVal( .VEPanel.Selected, ev.value )
205    
206    uint descr as ManEvents.Descrs[*ManEvents.Descrs - 1]
207    if resset & $EVENT_RENAME 
208    {
209       .GFSetMethodf( oldval, ev.value.str(), descr.EventType )
210    }
211    elif resset & $EVENT_NEW
212    {  
213       .GFSetMethodf( oldval, ev.value.str(), descr.EventType )
214    }
215    //.VEPanel.WE.green()
216    //.VEPanel.WE.select( .VEPanel.WE.winn->vCtrl )
217    .VEPanel.Selected = .VEPanel.Selected
218 }
219 
220 
221 method vComp.GetArrType( arr a of uint, uint typeid )
222 {
223    uint i
224    if this.TypeIs( typeid )
225    {
226       a[a.expand( 1 )] = &this
227    }   
228    fornum i=0, *this.Comps
229    {      
230       if this.Comps[i]->vComp.p_designing  
231       {
232          this.Comps[i]->vComp.GetArrType( a, typeid )
233       }
234    }
235 }  
236 
237 
238 method myform.getpropslist <alias=getpropslist>( evparEvent ev )
239 {  
240    uint cd as cm.GetCompDescr( .VEPanel.Selected.TypeId )
241    if &cd 
242    {     
243       uint p as cd.FindProp( .props.ar[ .props.ncur ].Name.str() )
244       if p.PropType == uint || p.PropType == int
245       {
246          if p.Vals
247          {
248             .props.cb.Clear()
249             foreach enval, p.Vals->arr of CompEnumVal  
250             {
251                .props.cb.AddItem( enval.Name.ustr(), 0->ustr, 0 )
252             }
253          }        
254       }
255       elif ( p.PropType == vComp || type_isinherit( p.PropType, vComp ))
256       {
257          arr a of uint
258          .props.cb.Clear()
259          .VEPanel.Selected.GetForm()->vComp.GetArrType( a, p.PropType )
260          foreach item, a
261          {
262             .props.cb.AddItem( item->vComp.Name.ustr(), 0->ustr, 0 )     
263          }
264       }
265    }
266 }
267 
268 method myform.geteventslist <alias=geteventslist>( evparEvent ev )
269 {
270    uint cd as cm.GetCompDescr( .VEPanel.Selected.TypeId )
271    if &cd 
272    {
273       uint event as cd.FindEvent( .events.ar[ .events.ncur ].Name.str() )
274     
275       .events.cb.Clear()
276     
277       if &event
278       {
279          
280          foreach descr, ManEvents.Descrs
281          {
282             if descr.EventType == event.EventType 
283             {
284     
285                .events.cb.AddItem( descr.MethodName.ustr(), 0->ustr, 0 )
286             }
287          }  
288       }
289    }  
290 }
291 
292 
293 
294 //Выбор текущего компонента
295 method myform.compselect <alias=compselect>( evparEvent ev )
296 {
297    if &.VEPanel.Selected()//.VEPanel.WE.winn
298    {
299       .flgchanged = 1
300       arr ap of PropItem
301       arr ae of PropItem 
302       cm.GetPropList( .VEPanel.Selected, ap, ae )   
303       .props.setar( ap )       
304       .events.setar( ae )   
305       .edcurcomp.Text =  "     ".ustr() + .VEPanel.Selected.TypeName + "     " +.VEPanel.Selected.Name
306       if .CurCompEdit
307       {  
308          .CurCompEdit->vForm.Virtual( $mSelectComp, .VEPanel.Selected )
309       }
310    }
311 }
312 
313 
314 method vComp myform.newcompdes( uint typeid, vComp owner )
315 {   
316    uint comp as owner.CreateComp( typeid, 1 )->vComp
317    if &comp
318    {
319       uint curn
320       str name
321       str typename = comp.TypeName            
322       uint ar as new( arr of uint )->arr of uint
323       //ar.expand( 1 )       
324       ar.expand( *cm.GetCompDescr( typeid ).Events )
325       comp.des1 = &ar
326       if *comp.TypeName > 1 
327       {  
328          typename.substr( comp.TypeName, 1, *comp.TypeName-1 )
329       }
330       else
331       {
332          typename = comp.TypeName
333       }
334       do
335       {         
336          name = typename + "\(curn++)"               
337       }
338       while &(.edform->vForm.FindComp( name ))                     
339       comp.Name = name
340       comp.p_designing = 1      
341       //.GetNoVis()
342       .VEPanel.Update()
343    }
344    return comp
345 }
346 
347 
348 method myform.QueryCreate <alias=myform_QueryCreate >( evparQueryCreate  evpQ )
349 {
350    //uint b as .newcompdes( .VEPanel.WE.flgadd, .VEPanel.WE.winn->vComp )
351       
352    //uint b as this.newctrl( typeid )
353    if evpQ.NewComp = &.newcompdes( ?( evpQ.TypeId, evpQ.TypeId, .VEPanel.WE.flgadd ) , evpQ.Owner->vComp ) 
354    {         
355       uint b as evpQ.NewComp->vComp
356       if b.TypeIs( vVirtCtrl )
357       {         
358          b as vVirtCtrl
359          b.Left = evpQ.loc.left
360          b.Top = evpQ.loc.top
361          if evpQ.loc.width : b.Width = evpQ.loc.width
362          if evpQ.loc.height : b.Height = evpQ.loc.height
363       }  
364       //this.bt_arrow.checked = 1
365       .GFSetHeaderf()      
366       //.GFSetProps()
367       .flgchanged = 1      
368       if .objtv.Selected && .objtv.Selected.Tag 
369       {
370          .objtv.Selected = .objtv.Selected.Parent
371       }
372       //.btArrow.Checked = 1
373    }    
374    
375    //arr ap of PropItem 
376    //cm.GetPropList( .VEPanel.WE.winn->vComp, ap )   
377    //.props.setar( ap )
378 }
379 
380 
381 
382 method myform.New()
383 {
384    if .flgchanged: .GFSave( 1 )
385    if .edform
386    {
387       .edform->vComp.DestroyComp()
388       .VEPanel.NoVisList.Rows.Clear()
389       ManEvents.Descrs.clear()
390    }
391    ManEvents.Descrs.expand(1)
392       
393    uint newform as .VEPanel.VisPanel->vComp.CreateComp( vForm )->vForm
394    uint ar as new( arr of uint )->arr of uint            
395    ar.expand( *cm.GetCompDescr( vForm ).Events )
396    newform.des1 = &ar
397    
398    newform.p_designing = 1
399    newform.TabOrder = 0      
400    .edform = &newform
401    newform.Name = "Form0"   
402    .GFSetNew()      
403    .Caption = "New".ustr()
404    .VEPanel.WE.select( newform->vCtrl )   
405    .VEPanel.Selected = newform   
406    .VEPanel.Virtual( $mDesChanged, .VEPanel.Selected )
407    .flgchanged = 0
408    .flgsaved = 0 
409    
410            
411 }
412 
413 type aftercreate
414 {
415    uint prop
416    uint comp
417    ustr  val
418 }
419 
420 method vComp vComp.Load( gtitem gi, arr after of aftercreate )
421 {   
422    uint typeid = gettypeid( gi.get( "TypeName" ) )
423    
424    if typeid
425    {
426       uint comp as this.CreateComp( typeid, 1 )->vComp      
427       //comp.p_designing = 1    
428       comp.p_loading = 1
429       uint ar as new( arr of uint )->arr of uint            
430       ar.expand( *cm.GetCompDescr( typeid ).Events )
431       comp.des1 = &ar      
432       uint props as gi.findrel( "/Properties" )
433       if &props
434       {
435          foreach prop, props  
436          {            
437             ustr val            
438             val.fromutf8( prop->gtitem.value )            
439             uint compprop as cm.GetCompDescr( typeid ).FindProp( prop->gtitem.name )
440             if &compprop 
441             {            
442                if compprop.PropFlags & $PROP_LOADAFTERCREATE
443                {
444                   uint curafter as after[after.expand(1)]
445                   curafter.comp = &comp
446                   curafter.val = val
447                   curafter.prop = &compprop
448                }
449                else : compprop.SetVal( comp, val )
450             }           
451          }                                 
452       }      
453       uint events as gi.findrel( "/Events" )
454       if &events
455       {      
456          foreach event, events  
457          {            
458             ustr val
459             val.fromutf8( event->gtitem.value )            
460             uint compevent as cm.GetCompDescr( typeid ).FindEvent( event->gtitem.name )            
461             if &compevent : compevent.SetVal( comp, val )            
462          }                      
463       }            
464       uint children as gi.findrel( "/Children" )
465       if &children   
466       {     
467          foreach obj, children  
468          {            
469             comp.Load( obj->gtitem, after) 
470          }
471       }
472       props as gi.findrel( "/PropertiesAfter" )
473       if &props
474       {
475          foreach prop, props  
476          {            
477             ustr val
478             val.fromutf8( prop->gtitem.value )
479             uint compprop as cm.GetCompDescr( typeid ).FindProp( prop->gtitem.name )
480             if &compprop : compprop.SetVal( comp, val )           
481          }                                 
482       }
483       comp.p_loading = 0
484       return comp
485    }   
486    return 0->vComp
487 }
488 
489 method myform.Open ( str filename )
490 {
491    gt g   
492    
493    .filename = filename
494    
495    if !.gffile.read( .filename + ".gf" ) : return 
496    g.read( .filename + ".frm" ) 
497    .Caption = .filename.ustr() + ".gf"
498    
499    //0->vComp.Load( g.root().findrel( "/Object" ) )
500    ManEvents.Descrs.clear()
501    ManEvents.Descrs.expand(1)
502    
503    foreach obj, g.root()
504    {
505    
506       arr after of aftercreate      
507       uint newform as .VEPanel.VisPanel->vComp.Load( obj->gtitem, after )->vForm      
508       uint i
509       fornum i = 0, *after
510       {
511          uint curafter as after[i]
512          curafter.prop->CompProp.SetVal( curafter.comp->vComp, curafter.val )
513       }
514       
515       if &newform 
516       {
517       
518          if .edform
519          {
520             .edform->vForm.DestroyComp()
521             .VEPanel.NoVisList.Rows.Clear()
522          }
523          .edform = &newform
524          newform.p_designing = 1
525          newform.TabOrder = 0
526          //.VEPanel.WE.select( newform->vCtrl )
527          .VEPanel.Selected = newform
528          .VEPanel.Virtual( $mDesChanged, .VEPanel.Selected )
529          
530       }
531       break
532       
533    }
534    .VEPanel.Update()
535    .flgchanged = 0
536    .flgsaved = 1   
537 }
538 
539 method myform.OpenQuery
540 {      
541    if .flgchanged: .GFSave( 1 )
542    
543    .dlgOpen.DefExt = ".gf".ustr()
544    .dlgOpen.Filters[0]= "Gentee form (*.gf)\\*.gf".ustr()
545    .dlgOpen.FileName = "".ustr()
546    if !.dlgOpen.ShowOpenFile() : return
547    str dir, fname   
548    .dlgOpen.FileName.str().fgetparts( dir, fname, 0->str )
549    .Open( dir + "\\" + fname )
550       //this.Save( ev )
551 }
552 
553 method myform.btnRun_click <alias=btnRun_click> ( evparEvent ev )
554 {   
555    //.md.Owner = this
556    //.md.Visible = 1
557    
558    .GFSave( 0 )     
559    if .flgsaved
560    {
561       if *.prj.runfile
562       {   
563          //process( "\"\( getmodulepath( "", "gentee.exe" ) )\" \"\(.prj.runfile)\"", "".fgetdir(.prj.runfile), 0 )
564          setcurdir( "".fgetdir( .prj.runfile ) )
565          shell( .prj.runfile ) 
566       }      
567       else
568       {             
569          //process( "\"\( getmodulepath( "", "gentee.exe" ) )\" \"\(.filename).g\"", "".fgetdir(.filename), 0 )
570          shell( "\(.filename).g" )
571       }
572    }
573 }
574 
575 
576 method myform.objtv_afterselect <alias=myform_objtv_afterselect> ( evparValUint eva )
577 {
578    if eva.val
579    {
580       this.VEPanel.WE.flgadd = eva.val->TVItem.Tag
581    }
582    else : this.VEPanel.WE.flgadd = 0
583 }
584 
585 method myform.NewFile <alias=NewFile> ( evparEvent ev) 
586 {
587    this.New()
588 }
589 
590 method myform.OpenFile <alias=OpenFile> (evparEvent ev) 
591 {
592    this.OpenQuery()
593 }
594 
595 method myform.OpenProject( str filename )
596 {
597    gt g    
598    uint gi, gc
599    g.read( filename )
600    gi as g.root().findrel( "/project" )
601    if &gi 
602    {    
603       .prj.filename = filename
604       gc as gi.findrel( "/runfile" )
605       if &gc : .prj.runfile = gc.value 
606       gc as gi.findrel( "/resources" )
607       if &gc : .prj.resources = gc.value
608       if &gc 
609       {
610          .prj.resources = gc.value
611          DesApp.Lng.load( .prj.resources + "\\language", "english", "english" )
612          DesApp.ImgM.MainDir = .prj.resources + "images" 
613          DesApp.ImgM.Load( "default", 1 )
614          .edform->vForm.Virtual( $mLangChanged )
615          
616       } 
617    }  
618 }
619 
620 method myform.OpenProjectQuery <alias=OpenProjectQuery> (evparEvent ev) 
621 {  
622    .dlgOpen.DefExt = ".gp".ustr()
623    .dlgOpen.Filters[0]= "Gentee project (*.gp)\\*.gp".ustr()
624    .dlgOpen.FileName = "".ustr()
625    if !.dlgOpen.ShowOpenFile() : return   
626    .OpenProject( .dlgOpen.FileName.str() )  
627    
628    //.prj.resources = 
629    
630    //0->vComp.Load( g.root().findrel( "/Object" ) )
631    
632    //Open( dir + "\\" + fname )
633 }
634 
635 method myform.SaveFile <alias=SaveFile> (evparEvent ev) 
636 {
637    .GFSave( 0 )   
638 }
639 
640 method myform.SaveAsFile <alias=SaveAsFile> (evparEvent ev) 
641 {
642    .GFSave( 1 )   
643 }
644 
645 
646 method myform.QuerySelect <alias=myform_QuerySelect>( evparValUint eQS )
647 {   
648    //.VEPanel.WE.select( eQS.val->vComp )
649    .VEPanel.Selected = eQS.val->vComp     
650 }
651 
652 method myform.CompEditDelete <alias=myform_CompEditDelete>( evparEvent ev )
653 {
654    .CurCompEdit = 0
655 }
656 
657 
658 method myform.VEPanel_DblClick <alias=myform_VEPanel_DblClick> ( evparValUint evn )
659 {
660    
661    uint comp as .VEPanel.Selected
662    
663    if &comp && !.CurCompEdit 
664    {  
665       if comp.TypeIs( vCustomMenu )
666       {
667          .CurCompEdit = &comp->vCustomMenu.Design( this, myform_QueryCreate, myform_QuerySelect, myform_CompEditDelete )
668       }
669       elif comp.TypeIs( vTab )
670       {         
671          .CurCompEdit = &comp->vTab.Design( this, myform_QueryCreate, myform_QuerySelect, myform_CompEditDelete )  
672       }
673       elif comp.TypeIs( vToolBar ) 
674       {
675          //newcompdes( vToolBarItem, comp )
676          evparQueryCreate eQC
677          eQC.Owner = &comp
678          eQC.TypeId = vToolBarItem                  
679          .QueryCreate( eQC )
680          
681          //.flgchanged = 1  
682       }
683       if .CurCompEdit
684       {
685          POINT pos
686          pos.x = .VEPanel.Left
687          pos.y = .VEPanel.Top
688          ClientToScreen( this.hwnd, pos )
689          .CurCompEdit->vForm.Left = pos.x//.VEPanel.Left
690          .CurCompEdit->vForm.Top = pos.y//.VEPanel.Top
691          SetFocus( .CurCompEdit->vForm.hwnd )
692       }                                
693    }
694 }
695 
696 
697 
698 method myform.CloseQuery <alias=myform_CloseQuery>( evparQuery evpQ )
699 {   
700    if .flgchanged : .GFSave( 1 )   
701    if .flgsaved 
702    {
703    
704       ini prefs
705       prefs.setvalue( "PROJECT", "last", .filename )
706       prefs.setvalue( "PROJECT", "project", .prj.filename )
707       prefs.write( .curdir + "\\visedit.ini" )
708    }
709    //evpQ.flgCancel = 1
710    //this.DestroyComp()
711 }
712 
713 
714 global
715 {
716 ustr xxx 
717 }
718 
719 func t<main>
720 {
721    
722    uint mybtn
723    myform x
724    getcurdir( x.curdir )   
725    App.ImgM.MainDir = x.curdir + "\\images" 
726    App.ImgM.Load( "default", 1 )
727    App.Load()   
728    if App.Lng.load( x.curdir + "\\language", "english", "english")
729    {
730       ustr u
731    }
732       
733    x.Owner = App
734    
735    
736    
737    //ti.lParam = 
738    x.OnCloseQuery.Set( x, myform_CloseQuery )
739    /*x.hwndTip = CreateWindowEx( 0, "tooltips_class32".ustr().ptr(), 0,
740                             $WS_POPUP | 0x01 | 0x02, // | $TTS_NOPREFIX | $TTS_ALWAYSTIP,
741                             0x80000000, 0x80000000,
742                             0x80000000, 0x80000000, //$CW_USEDEFAULT,
743                             0, 0, GetModuleHandle( 0 ), 0)
744    SetWindowPos(x.hwndTip, $HWND_TOPMOST,0, 0, 0, 0,
745              $SWP_NOMOVE | $SWP_NOSIZE | $SWP_NOACTIVATE)
746                              
747    TOOLINFO ti
748    ti.cbSize = sizeof( TOOLINFO ) + 10
749    ti.uFlags = $TTF_SUBCLASS//0//$TTF_IDISHWND //| $TTF_SUBCLASS //$TTF_IDISHWND |
750    ti.hwnd = x.hwnd 
751    ti.uId = x.hwnd
752    ti.rect.right = 200
753    ti.rect.bottom = 200
754    //ti.hinst = GetModuleHandle( 0 )   
755    ti.lpszText = "test sdddddddddddddddddd".ustr().ptr()
756    //ti.lParam = 
757    */
758    
759 //FreeConsole()
760    with x.VEPanel
761    {
762       .Owner = x
763       .Left = 200
764       .Width = x.Width - .Left
765       .HorzAlign = $alhLeftRight
766       .VertAlign = $alvClient
767       
768    }  
769    
770    x.MainMenu.Owner = x
771    uint cim, csim
772    cim as x.MainMenu.CreateComp( vMenuItem )->vMenuItem
773    cim.Caption = "file".ustr()
774    csim as cim.CreateComp( vMenuItem )->vMenuItem
775    csim.OnClick.Set( x, NewFile )
776    csim.Caption = "New".ustr()
777    csim as cim.CreateComp( vMenuItem )->vMenuItem
778    csim.Caption = "Open".ustr()
779    csim.OnClick.Set( x, OpenFile )
780    csim as cim.CreateComp( vMenuItem )->vMenuItem
781    csim.Caption = "Save".ustr()
782    csim.OnClick.Set( x, SaveFile )
783    csim as cim.CreateComp( vMenuItem )->vMenuItem
784    csim.Caption = "Save as".ustr()
785    csim.OnClick.Set( x, SaveAsFile )
786    csim as cim.CreateComp( vMenuItem )->vMenuItem
787    csim.Caption = "Open project".ustr()
788    csim.OnClick.Set( x, OpenProjectQuery ) 
789    
790    uint panleft as x.CreateComp( vPanel )->vPanel
791    panleft.HorzAlign = $alhLeft
792    panleft.Width = 200   
793    panleft.VertAlign = $alvClient
794    //panleft.Visible = 0   
795    //panleft.Border = $brdLowered
796    //panleft.Border = 0
797    
798    mybtn as panleft.CreateComp( vBtn )->vBtn   
799    mybtn.Top = 0
800    mybtn.HorzAlign = $alhCenter
801    mybtn.Caption = "Run".ustr()
802    mybtn.OnClick.Set(x,btnRun_click)
803    //x.Label.Owner = panleft->vComp
804     
805    with x.objtv
806    {
807       .Owner = panleft
808       .HorzAlign = $alhClient
809       .Top = mybtn.Top + mybtn.Height
810       .Height = 150      
811       //.VertAlign = $alvTopBottom      
812       .ShowSelection = 1
813       .RowSelect = 1
814       .OnAfterSelect.Set( x, myform_objtv_afterselect )
815    
816       uint winlist as x.objtv.Root.AppendChild( "Windows objects".ustr(), 0 )
817       winlist.SortType = $TVSORT_SORT
818       foreach descr, cm.Descrs
819       {  
820          if descr.VisComp 
821          {         
822             str typename
823             typename.substr( descr.TypeName, 1, *descr.TypeName-1 )
824             winlist.AppendChild( typename.ustr(), descr.TypeId )            
825          }      
826       }
827       winlist.Expanded = 1
828    }
829    
830    with x.edcurcomp
831    {
832       .Owner = panleft
833       .Border = 0
834       .Top = x.objtv.Top + x.objtv.Height
835       .Height = 20
836       .HorzAlign = $alhClient
837       .ReadOnly = 1
838       .TabStop = 0
839       //.Enabled = 0
840    }
841  
842    uint tabbottom as panleft.CreateComp( vTab )->vTab   
843    tabbottom.Top = x.edcurcomp.Top + x.edcurcomp.Height   
844    tabbottom.VertAlign = $alvTopBottom
845    tabbottom.HorzAlign = $alhClient
846    tabbottom.Bottom = 0   
847    uint tiProperties as tabbottom.CreateComp( vTabItem )->vTabItem   
848    tiProperties.Caption = "Properties".ustr()   
849    uint tiEvents as tabbottom.CreateComp( vTabItem )->vTabItem   
850    tiEvents.Caption = "Events".ustr()
851      
852    x.props.Owner = tiProperties   
853    x.props.HorzAlign = $alhClient   
854    x.props.VertAlign = $alvClient   
855    x.props.onPropSet.Set( x, propset )      
856    x.props.ongetlist.Set( x, getpropslist )   
857    x.events.Owner = tiEvents   
858    x.events.HorzAlign = $alhClient
859    x.events.VertAlign = $alvClient
860    x.events.onPropSet.Set( x, eventset )
861    x.events.ongetlist.Set( x, geteventslist )      
862 //   x.VEPanel.WE.Owner = x.panEdVis
863 //   x.VEPanel.WE.onSelect.set( x, compselect )
864 //   x.VEPanel.WE.onNew.set( x, myform_QueryCreate )
865 
866    x.VEPanel.onSelect.Set( x, compselect )
867    x.VEPanel.onQueryCreate.Set( x, myform_QueryCreate )
868    x.VEPanel.OnDblClick.Set( x, myform_VEPanel_DblClick )
869    
870 
871    x.dlgOpen.Owner = x
872    x.dlgOpen.DefExt = "gf".ustr()
873    
874    x.dlgOpen.Filters.expand(2)         
875    x.dlgOpen.InitialDir = $"K:\gentee\".ustr()
876    
877    ini prefs
878    str filename
879    prefs.read( x.curdir + "\\visedit.ini" )
880    if prefs.getvalue( "PROJECT", "last", filename, "" ) &&
881       *filename
882    {      
883       x.Open( filename )
884       filename.clear()
885       prefs.getvalue( "PROJECT", "project", filename, "" )
886       x.OpenProject( filename )
887    }
888    else
889    {
890       x.New()   
891    }
892    
893    App.Run()   
894 }
895