Class: ArcadiaLayout

Inherits:
Object
  • Object
show all
Defined in:
lib/a-core.rb

Instance Method Summary collapse

Constructor Details

#initialize(_arcadia, _frame, _autotab = true) ⇒ ArcadiaLayout

)



1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
# File 'lib/a-core.rb', line 1032

def initialize(_arcadia, _frame, _autotab=true)
  @arcadia = _arcadia
  @frames = Array.new
  @frames[0] = Array.new
  @frames[0][0] = _frame
  @domains = Array.new
  @domains[0] = Array.new
  @domains[0][0] = '_domain_root_'
  @panels = Hash.new
  @panels['_domain_root_']= Hash.new
  @panels['_domain_root_']['root']= _frame
  @panels['_domain_root_']['sons'] = 	Hash.new
  @autotab = _autotab
  @headed = false
  @wrappers=Hash.new
  #ArcadiaContractListener.new(self, MainContract, :do_main_event)
end

Instance Method Details

#[](_row, _col) ⇒ Object



2236
2237
2238
# File 'lib/a-core.rb', line 2236

def [](_row, _col)
  @frames[_row][_col]
end

#add_cols(_row, _col, _width, _left_name = nil, _right_name = nil) ⇒ Object



1320
1321
1322
# File 'lib/a-core.rb', line 1320

def add_cols(_row,_col, _width, _left_name=nil, _right_name=nil)
  _prepare_cols(_row,_col, _width, false, _left_name, _right_name)
end

#add_cols_perc(_row, _col, _width, _left_name = nil, _right_name = nil) ⇒ Object



1324
1325
1326
# File 'lib/a-core.rb', line 1324

def add_cols_perc(_row,_col, _width, _left_name=nil, _right_name=nil)
  _prepare_cols(_row,_col, _width, true, _left_name, _right_name)
end

#add_cols_runtime(_domain) ⇒ Object



1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
# File 'lib/a-core.rb', line 1328

def add_cols_runtime(_domain)
  saved_root_splitted_frames = @panels[_domain]['root_splitted_frames']
  _saved = Hash.new
  _saved.update(@panels[_domain]['sons'])
  geometry = TkWinfo.geometry(@panels[_domain]['root'])
  width = geometry.split('x')[0].to_i/2
  _saved.each{|name,ffw|
    unregister_panel(ffw, false, false)
  }
  unbuild_titled_frame(_domain)
  _row,_col = _domain.split('.')
  add_cols(_row.to_i,_col.to_i, width)
  build_titled_frame(_domain)
  build_titled_frame(domain_name(_row.to_i,_col.to_i+1))
  _saved.each{|name,ffw|
    ffw.domain = _domain
    register_panel(ffw, ffw.hinner_frame)    
  }
  if saved_root_splitted_frames
    @panels[_domain]['root_splitted_frames']=saved_root_splitted_frames
  end
  build_invert_menu(true)
end

#add_commons_menu_items(_domain, _menu) ⇒ Object



1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
# File 'lib/a-core.rb', line 1846

def add_commons_menu_items(_domain, _menu)
    _menu.insert('end', :separator)
    _menu.insert('end',:command,
        :label=>"add column",
        :image=>TkPhotoImage.new('dat'=>ADD_GIF),
        :compound=>'left',
        :command=>proc{add_cols_runtime(_domain)},
        :hidemargin => true
    )
    _menu.insert('end',:command,
        :label=>"add row",
        :image=>TkPhotoImage.new('dat'=>ADD_GIF),
        :compound=>'left',
        :command=>proc{add_rows_runtime(_domain)},
        :hidemargin => true
    )
    if @panels.keys.length > 2
      _menu.insert('end',:command,
          :label=>"close",
          :image=>TkPhotoImage.new('dat'=>CLOSE_FRAME_GIF),
          :compound=>'left',
          :command=>proc{close_runtime(_domain)},
          :hidemargin => true
      )
    end
end

#add_headersObject



1896
1897
1898
1899
1900
1901
1902
1903
# File 'lib/a-core.rb', line 1896

def add_headers
  @domains.each{|row|
    row.each{|domain|
      build_titled_frame(domain)
    }
  }
  @headed = true
end

#add_rows(_row, _col, _height, _top_name = nil, _bottom_name = nil) ⇒ Object



1132
1133
1134
# File 'lib/a-core.rb', line 1132

def add_rows(_row,_col, _height, _top_name=nil, _bottom_name=nil)
		_prepare_rows(_row,_col, _height, false, _top_name, _bottom_name)
end

#add_rows_perc(_row, _col, _height, _top_name = nil, _bottom_name = nil) ⇒ Object



1136
1137
1138
# File 'lib/a-core.rb', line 1136

def add_rows_perc(_row,_col, _height, _top_name=nil, _bottom_name=nil)
		_prepare_rows(_row,_col, _height, true, _top_name, _bottom_name)
end

#add_rows_runtime(_domain) ⇒ Object



1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
# File 'lib/a-core.rb', line 1352

def add_rows_runtime(_domain)
  saved_root_splitted_frames = @panels[_domain]['root_splitted_frames']
  _saved = Hash.new
  _saved.update(@panels[_domain]['sons'])
  geometry = TkWinfo.geometry(@panels[_domain]['root'])
  height = geometry.split('+')[0].split('x')[1].to_i/2
  _saved.each{|name,ffw|
    unregister_panel(ffw, false, false)
  }
  unbuild_titled_frame(_domain)
  _row,_col = _domain.split('.')
  add_rows(_row.to_i,_col.to_i, height)
  build_titled_frame(_domain)
  build_titled_frame(domain_name(_row.to_i+1,_col.to_i))
  _saved.each{|name,ffw|
    ffw.domain = _domain
    register_panel(ffw, ffw.hinner_frame)    
  }
  if saved_root_splitted_frames
    @panels[_domain]['root_splitted_frames']=saved_root_splitted_frames
  end

  build_invert_menu(true)
end

#all_domains(_frame) ⇒ Object

def others_domains(_frame, _vertical=true)

    if _vertical
      splitter_adapter_class = AGTkVSplittedFrames
    else
      splitter_adapter_class = AGTkOSplittedFrames
    end
    splitted_adapter = find_splitted_frame(_frame)
    consider_it = splitted_adapter.instance_of?(splitter_adapter_class) && splitted_adapter.frame1 == _frame
    if splitted_adapter && !consider_it && splitted_adapter != _frame
       rif_frame = splitted_adapter.frame
       ret = others_domains(rif_frame)
    elsif splitted_adapter && consider_it
      ret = domains_on_frame(splitted_adapter.frame2)
    else
      ret = Array.new
    end
    ret    
end


1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
# File 'lib/a-core.rb', line 1159

def all_domains(_frame)
    splitted_adapter = find_splitted_frame(_frame)
    consider_it = splitted_adapter.kind_of?(AGTkSplittedFrames)
    if consider_it
      ret = domains_on_frame(splitted_adapter.frame2).concat(domains_on_frame(splitted_adapter.frame1))
    else
      ret = Array.new
    end
    ret    
end

#all_domains_cols(_frame) ⇒ Object



1170
1171
1172
1173
1174
1175
1176
1177
# File 'lib/a-core.rb', line 1170

def all_domains_cols(_frame)
  ret = Array.new
  all_domains(_frame).each{|d|
    v = d.split('.')[1]
    ret << v if !ret.include?(v)
  }
  ret
end

#all_domains_rows(_frame) ⇒ Object



1179
1180
1181
1182
1183
1184
1185
1186
# File 'lib/a-core.rb', line 1179

def all_domains_rows(_frame)
  ret = Array.new
  all_domains(_frame).each{|d|
    v = d.split('.')[0]
    ret << v if !ret.include?(v)
  }
  ret
end

#autotab?Boolean

Returns:

  • (Boolean)


1909
1910
1911
# File 'lib/a-core.rb', line 1909

def autotab?
  @autotab
end

#build_invert_menu(refresh_commons_items = false) ⇒ Object



1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
# File 'lib/a-core.rb', line 1997

def build_invert_menu(refresh_commons_items=false)
  @panels.keys.each{|dom|
    if dom != '_domain_root_' && @panels[dom] && @panels[dom]['root']
      menu = @panels[dom]['root'].menu_button('ext').cget('menu')
      if refresh_commons_items
         @panels[dom]['root'].menu_button('ext').cget('menu').delete('0','end')
         add_commons_menu_items(dom, menu)
      else
        if @panels.keys.length > 2
          i=menu.index('end').to_i-4
        else
          i=menu.index('end').to_i-3
        end
        if i >= 0
          end_index = i.to_s
          @panels[dom]['root'].menu_button('ext').cget('menu').delete('0',end_index)
        end
      end
    end
  }
  
  @wrappers.each{|name,ffw|
    process_frame(ffw) #if ffw.domain
  }
end

#build_titled_frame(domain) ⇒ Object



1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
# File 'lib/a-core.rb', line 1873

def build_titled_frame(domain)
  if @panels[domain]
    tframe = TkTitledFrame.new(@panels[domain]['root']).place('x'=>0, 'y'=>0,'relheight'=>1, 'relwidth'=>1)
    mb = tframe.add_menu_button('ext')
    # add commons item
    menu = mb.cget('menu')
    add_commons_menu_items(domain, menu)
    @panels[domain]['root']= tframe
    #-----------------------------------
#      class << tframe
#        def set_domain(_domain)
#          if @label_domain.nil?
#            @label_domail = TkLabel.new(self.frame, 'text'=>_domain).pack
#          else
#            @label_domain.configure('text'=>_domain)
#          end
#        end
#      end
#      tframe.set_domain(domain)
    #-----------------------------------
  end
end

#change_domain(_target_domain, _source_name) ⇒ Object



1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
# File 'lib/a-core.rb', line 1917

def change_domain(_target_domain, _source_name)
  tt1= @panels[_target_domain]['root'].top_text
  source_domain = @wrappers[_source_name].domain
  source_has_domain = !source_domain.nil?
  tt2= @panels[source_domain]['root'].top_text if source_has_domain
  if source_has_domain && @panels[source_domain]['sons'].length ==1 && @panels[_target_domain]['sons'].length > 0
    # change ------
    ffw1 = raised_fixed_frame(_target_domain)
    ffw2 = @panels[source_domain]['sons'].values[0]
    unregister_panel(ffw1,false,false) if ffw1
    unregister_panel(ffw2,false,false)
    ffw1.domain = source_domain if ffw1
    ffw2.domain = _target_domain
    register_panel(ffw1, ffw1.hinner_frame) if ffw1
    register_panel(ffw2, ffw2.hinner_frame)
    @panels[_target_domain]['root'].top_text(tt2)
    @panels[source_domain]['root'].top_text(tt1)
  elsif source_has_domain && @panels[source_domain]['sons'].length >= 1
    ffw2 = @panels[source_domain]['sons'][_source_name]
    unregister_panel(ffw2, false, false)
    ffw2.domain = _target_domain
    register_panel(ffw2, ffw2.hinner_frame)
    @panels[_target_domain]['root'].top_text(tt2)
    @panels[source_domain]['root'].top_text('')
  elsif !source_has_domain
    ffw2 = @wrappers[_source_name]
    ffw2.domain = _target_domain
    register_panel(ffw2, ffw2.hinner_frame)
    @panels[_target_domain]['root'].top_text('')
  end
  # refresh -----
  build_invert_menu
end

#close_runtime(_domain) ⇒ Object



1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
# File 'lib/a-core.rb', line 1749

def close_runtime(_domain)
  splitted_adapter = find_splitted_frame(@panels[_domain]['root'])
  splitted_adapter_frame = splitted_adapter.frame
  vertical = splitted_adapter.instance_of?(AGTkVSplittedFrames)
  _row, _col = _domain.split('.')
  if @frames[_row.to_i][_col.to_i] == splitted_adapter.frame1
    other_ds = domains_on_frame(@panels[_domain]['splitted_frames'].frame2)
  elsif @frames[_row.to_i][_col.to_i] == splitted_adapter.frame2
    other_ds = domains_on_frame(@panels[_domain]['splitted_frames'].frame1)
  end

  return if other_ds.nil?    


  if other_ds.length == 1
    other_domain = other_ds[0]
  elsif other_ds.length > 1
    max = other_ds.length-1
    j = 0
    while j <= max
      if other_domain.nil?
        other_domain = other_ds[j]
      else
        r,c = other_domain.split('.')
        new_r,new_c = other_ds[j].split('.')
        if new_r.to_i < r.to_i || new_r.to_i == r.to_i && new_c.to_i < c.to_i
          other_domain = other_ds[j]
        end
      end
      j = j+1
    end
  end
  _other_row, _other_col = other_domain.split('.')
  @panels[_domain]['sons'].each{|name,ffw|
    unregister_panel(ffw, false, false)
  }
  unbuild_titled_frame(_domain)

  if @panels[other_domain]['splitted_frames'] != @panels[_domain]['splitted_frames']
    if @panels[other_domain]['root_splitted_frames'].frame == @panels[_domain]['splitted_frames'].frame1 || @panels[other_domain]['root_splitted_frames'].frame == @panels[_domain]['splitted_frames'].frame2
      other_root_splitted_adapter = @panels[other_domain]['root_splitted_frames']
    elsif @panels[other_domain]['splitted_frames']
      other_root_splitted_adapter = @panels[other_domain]['splitted_frames']
    end
  end

  @panels.delete(_domain)
  @frames[_row.to_i][_col.to_i] = nil
  @domains[_row.to_i][_col.to_i] = nil

  if other_root_splitted_adapter
    if other_root_splitted_adapter != @panels[other_domain]['splitted_frames']
      other_ds.each{|d|
        if @panels[d]['root_splitted_frames'] == splitted_adapter
          @panels[d]['root_splitted_frames']=other_root_splitted_adapter
        end
      }
    end
    other_root_splitted_adapter.detach_frame
    splitted_adapter.detach_frame
    splitted_adapter.destroy
    other_root_splitted_adapter.attach_frame(splitted_adapter_frame)
  else
    other_source_save = Hash.new
    other_source_save.update(@panels[other_domain]['sons']) if @panels[other_domain]
    other_source_save.each{|name,ffw|
      unregister_panel(ffw, false, false)
    }
    splitted_adapter.detach_frame
    splitted_adapter.destroy
    @panels[other_domain]['root']=splitted_adapter_frame
    @frames[_other_row.to_i][_other_col.to_i] = splitted_adapter_frame
    build_titled_frame(other_domain)
    other_source_save.each{|name,ffw|
      ffw.domain = other_domain
      register_panel(ffw, ffw.hinner_frame)
    }
    parent_splitted_adapter = find_splitted_frame(@panels[other_domain]['root'])
    if  parent_splitted_adapter
      @panels[other_domain]['splitted_frames']=parent_splitted_adapter
    else
      @panels[other_domain]['splitted_frames']= nil
    end
  end
  build_invert_menu(true)
end

#close_runtime_old(_domain) ⇒ Object



1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
# File 'lib/a-core.rb', line 1501

def close_runtime_old(_domain)
  splitted_adapter = find_splitted_frame(@panels[_domain]['root'])
  splitted_adapter_frame = splitted_adapter.frame
  vertical = splitted_adapter.instance_of?(AGTkVSplittedFrames)
  
  _row, _col = _domain.split('.')
  
  if @frames[_row.to_i][_col.to_i] == splitted_adapter.frame1
    close_first = true
  elsif @frames[_row.to_i][_col.to_i] == splitted_adapter.frame2
    close_first = false
  end
  
  return if close_first.nil?    
  
  #source_domains = domains_on_frame(splitted_adapter.frame1).concat(domains_on_frame(splitted_adapter.frame2))
  #Arcadia.console(self,'msg'=>"domini coinvolti = #{source_domains.to_s}")
  
  @panels[_domain]['sons'].each{|name,ffw|
    unregister_panel(ffw, false, false)
  }
  unbuild_titled_frame(_domain)
  if close_first
    #left_frame
    other_ds = domains_on_frame(@panels[_domain]['splitted_frames'].frame2)
    if other_ds.length == 1
      source_domain = other_ds[0]
    elsif other_ds.length > 1
      max = other_ds.length-1
      j = 0
      while j <= max
        if source_domain.nil?
          source_domain = other_ds[j]
        else
          r,c = source_domain.split('.')
          new_r,new_c = other_ds[j].split('.')
          if new_r.to_i < r.to_i || new_r.to_i == r.to_i && new_c.to_i < c.to_i
            source_domain = other_ds[j]
          end
        end
        j = j+1
      end
    else
      if vertical
        source_domain = domain_name(_row.to_i, _col.to_i+1)
      else
        source_domain = domain_name(_row.to_i+1, _col.to_i)
      end
    end
    if vertical
      ref_source_domain = domain_name(_row.to_i, _col.to_i+1)
    else
      ref_source_domain = domain_name(_row.to_i+1, _col.to_i)
    end

    destination_domain = _domain
          
    if @panels[source_domain]['splitted_frames'] != @panels[destination_domain]['splitted_frames']
      if @panels[source_domain]['root_splitted_frames'] && @panels[source_domain]['root_splitted_frames'] != @panels[destination_domain]['splitted_frames']
        other_root_splitted_adapter = @panels[source_domain]['root_splitted_frames']
      elsif @panels[source_domain]['splitted_frames']
        other_root_splitted_adapter = @panels[source_domain]['splitted_frames']
      end
    end

    if other_root_splitted_adapter
      p "primo quadrante"
      other_root_splitted_adapter.detach_frame
      splitted_adapter.detach_frame
      splitted_adapter.destroy
      other_root_splitted_adapter.attach_frame(splitted_adapter_frame)
      if source_domain == ref_source_domain
        if vertical
          rows = domains_on_splitter_rows(other_root_splitted_adapter)
          rows.each{|r|
            shift_left(r.to_i,_col.to_i)
          }
        else
          cols = domains_on_splitter_cols(other_root_splitted_adapter)
          cols.each{|c|
            shift_top(_row.to_i,c.to_i)
          }
        end
      else
        @panels.delete(_domain)
        @frames[_row.to_i][_col.to_i] = nil
        @domains[_row.to_i][_col.to_i] = nil
#          ref_r,ref_c = ref_source_domain.split('.')
#          real_r,real_c=source_domain.split('.')
#          gap_r = ref_r.to_i - real_r.to_i
#          gap_c = ref_c.to_i - real_c.to_i
#          if gap_r != 0 && gap_c == 0 # vertical
#            doms = domains_on_splitter(other_root_splitted_adapter)
#            doms.each{|d|
#              r,c=d.split('.')
#              cur_r = r.to_i+gap_r
#              cur_domain = "#{cur_r}.#{_col}"
#              if @panels[cur_domain] != nil
#                shift_bottom(cur_r,_col.to_i)
#              end
#              @panels[cur_domain] = @panels[d]
#              @panels[cur_domain]['root'].set_domain(cur_domain)
#              @panels[cur_domain]['sons'].each{|name,ffw| ffw.domain=cur_domain}
#              @frames[cur_r.to_i][_col.to_i] = @frames[r.to_i][c.to_i]
#              @domains[cur_r.to_i][_col.to_i] = @domains[r.to_i][c.to_i]
#              
#              @panels.delete(d)
#              @frames[r.to_i][c.to_i] = nil
#              @domains[r.to_i][c.to_i] = nil
#            }
#          elsif gap_c != 0
#          end
      end
      @panels.delete(source_domain)
      if vertical
        @frames[_row.to_i][_col.to_i+1] = nil
        @domains[_row.to_i][_col.to_i+1] = nil
      else
        @frames[_row.to_i+1][_col.to_i] = nil
        @domains[_row.to_i+1][_col.to_i] = nil
      end
    else
      p "secondo quadrante"
      source_save = Hash.new
      source_save.update(@panels[source_domain]['sons']) if @panels[source_domain]
      source_save.each{|name,ffw|
        unregister_panel(ffw, false, false)
      }
      splitted_adapter.detach_frame
      splitted_adapter.destroy
      @panels[destination_domain]['root']=splitted_adapter_frame
      @frames[_row.to_i][_col.to_i] = splitted_adapter_frame
      @domains[_row.to_i][_col.to_i] = destination_domain
      build_titled_frame(destination_domain)
      @panels.delete(source_domain)
      if vertical
        @frames[_row.to_i][_col.to_i+1] = nil
        @domains[_row.to_i][_col.to_i+1] = nil
      else
        @frames[_row.to_i+1][_col.to_i] = nil
        @domains[_row.to_i+1][_col.to_i] = nil
      end
      source_save.each{|name,ffw|
        ffw.domain = destination_domain
        register_panel(ffw, ffw.hinner_frame)
      }
      #-----
      parent_splitted_adapter = find_splitted_frame(@panels[destination_domain]['root'])
      if  parent_splitted_adapter
        @panels[destination_domain]['splitted_frames']=parent_splitted_adapter
      else
        @panels[destination_domain]['splitted_frames']= nil
      end
      #-----
      source_row,source_col = source_domain.split('.')
#        shift_left(source_row.to_i,source_col.to_i)
      if vertical
        shift_left(source_row.to_i,source_col.to_i-1)
      else
        shift_top(source_row.to_i-1,source_col.to_i)
      end
    end
  else  # CLOSE OTHER
    # verifichiamo se la contro parte è uno splitter_adapter
    other_ds = domains_on_frame(@panels[_domain]['splitted_frames'].frame1)
    if other_ds.length == 1
      other_dom = other_ds[0]
    else
      if vertical
        other_dom = domain_name(_row.to_i, _col.to_i-1)
      else
        other_dom = domain_name(_row.to_i-1, _col.to_i)
      end
    end
    if @panels[_domain]['splitted_frames'] != @panels[other_dom]['splitted_frames']
      if @panels[other_dom]['root_splitted_frames'] && @panels[other_dom]['root_splitted_frames'] != @panels[_domain]['splitted_frames']
        other_root_splitted_adapter = @panels[other_dom]['root_splitted_frames']
      elsif @panels[other_dom]['splitted_frames']
        other_root_splitted_adapter = @panels[other_dom]['splitted_frames']
      end
    end

    if other_root_splitted_adapter
      p "terzo quadrante"
      other_root_splitted_adapter.detach_frame
      splitted_adapter.detach_frame
      splitted_adapter.destroy
      other_root_splitted_adapter.attach_frame(splitted_adapter_frame)

      @frames[_row.to_i][_col.to_i] = nil
      @domains[_row.to_i][_col.to_i] = nil
      @panels.delete(_domain)
    else
      p "quarto quadrante"
      source_save = Hash.new
      source_save.update(@panels[other_dom]['sons'])
      source_save.each{|name,ffw|
        unregister_panel(ffw, false, false)
      }
      splitted_adapter.detach_frame
      splitted_adapter.destroy
      @panels[other_dom]['root']=splitted_adapter_frame 

      @frames[_row.to_i][_col.to_i] = nil
      @domains[_row.to_i][_col.to_i] = nil
      build_titled_frame(other_dom)
      @panels.delete(_domain)

      source_save.each{|name,ffw|
        ffw.domain = other_dom
        register_panel(ffw, ffw.hinner_frame)
      }
      #-----
      parent_splitted_adapter = find_splitted_frame(@panels[other_dom]['root'])
      if  parent_splitted_adapter
        @panels[other_dom]['splitted_frames']=parent_splitted_adapter
      else
        @panels[other_dom]['splitted_frames']= nil
      end
      other_row,other_col = other_dom.split('.')
      @frames[other_row.to_i][other_col.to_i] = splitted_adapter_frame
      @domains[other_row.to_i][other_col.to_i] = other_dom
#        if vertical
#          @frames[_row.to_i][_col.to_i-1] = splitted_adapter_frame
#          @domains[_row.to_i][_col.to_i-1] = other_dom
#        else
#          @frames[_row.to_i-1][_col.to_i] = splitted_adapter_frame
#          @domains[_row.to_i-1][_col.to_i] = other_dom
#        end
    end

    if vertical
      shift_left(_row.to_i,_col.to_i)
    else
      shift_top(_row.to_i,_col.to_i)
    end
  end 
  build_invert_menu(true)
end

#domain(_domain_name) ⇒ Object

def domain_for_frame(_domain_name, _name)

  domain(@panels[_domain_name]['sons'][_name].domain)
end


2248
2249
2250
# File 'lib/a-core.rb', line 2248

def domain(_domain_name)
  @panels[_domain_name]
end

#domain_name(_row, _col) ⇒ Object



1226
1227
1228
# File 'lib/a-core.rb', line 1226

def domain_name(_row,_col)
  _row.to_s+'.'+_col.to_s
end

#domain_root_frame(_domain_name) ⇒ Object



2252
2253
2254
# File 'lib/a-core.rb', line 2252

def domain_root_frame(_domain_name)
  @panels[_domain_name]['root'].frame
end

#domains_cols(_domains) ⇒ Object



1423
1424
1425
1426
1427
1428
1429
1430
# File 'lib/a-core.rb', line 1423

def domains_cols(_domains)
  ret = Array.new
  _domains.each{|d|
    v = d.split('.')[1]
    ret << v if !ret.include?(v)
  }
  ret
end

#domains_on_frame(_frame) ⇒ Object



1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
# File 'lib/a-core.rb', line 1465

def domains_on_frame(_frame)
  ret_doms = Array.new
  frame_found = false
  @panels.keys.each{|dom|
    if dom != '_domain_root_'
       if (@panels[dom]['splitted_frames'] != nil && @panels[dom]['splitted_frames'].frame == _frame) || (@panels[dom]['root_splitted_frames'] != nil && @panels[dom]['root_splitted_frames'].frame  == _frame)
         ret_doms.concat(domains_on_frame(@panels[dom]['splitted_frames'].frame1))
         ret_doms.concat(domains_on_frame(@panels[dom]['splitted_frames'].frame2))
         frame_found = true
         break
       elsif @panels[dom]['notebook'] != nil 
         cfrs = TkWinfo.children(_frame)
         if cfrs && cfrs.length == 1 && cfrs[0].instance_of?(TkTitledFrame) && TkWinfo.parent(@panels[dom]['notebook'])== cfrs[0].frame
           ret_doms << dom
           frame_found = true
         end       
       elsif @panels[dom]['root'].instance_of?(TkTitledFrame) && @panels[dom]['root'].parent == _frame 
           ret_doms << dom
           frame_found = true
       end
    end
  }    
  
  if !frame_found
    cfrs = TkWinfo.children(_frame)
    if cfrs && cfrs.length == 1 && cfrs[0].instance_of?(TkTitledFrame)
      @wrappers.each{|name, ffw|
        if ffw.hinner_frame.frame == cfrs[0].frame
          ret_doms << ffw.domain 
        end
      }
    end
  end
  return ret_doms
end

#domains_on_frame_cols(_frame) ⇒ Object



1433
1434
1435
1436
1437
1438
1439
1440
# File 'lib/a-core.rb', line 1433

def domains_on_frame_cols(_frame)
  ret = Array.new
  domains_on_frame(_frame).each{|d|
    v = d.split('.')[1]
    ret << v if !ret.include?(v)
  }
  ret
end

#domains_on_frame_rows(_frame) ⇒ Object



1377
1378
1379
1380
1381
1382
1383
1384
# File 'lib/a-core.rb', line 1377

def domains_on_frame_rows(_frame)
  ret = Array.new
  domains_on_frame(_frame).each{|d|
    v = d.split('.')[0]
    ret << v if !ret.include?(v)
  }
  ret
end

#domains_on_splitter(_splitter) ⇒ Object



1442
1443
1444
# File 'lib/a-core.rb', line 1442

def domains_on_splitter(_splitter)
  domains_on_frame(_splitter.frame1).concat(domains_on_frame(_splitter.frame2))  
end

#domains_on_splitter_cols(_splitter) ⇒ Object



1446
1447
1448
1449
1450
1451
1452
1453
# File 'lib/a-core.rb', line 1446

def domains_on_splitter_cols(_splitter)
  ret = Array.new
  domains_on_splitter(_splitter).each{|d|
    v = d.split('.')[1]
    ret << v if !ret.include?(v)
  }
  ret
end

#domains_on_splitter_rows(_splitter) ⇒ Object



1455
1456
1457
1458
1459
1460
1461
1462
# File 'lib/a-core.rb', line 1455

def domains_on_splitter_rows(_splitter)
  ret = Array.new
  domains_on_splitter(_splitter).each{|d|
    v = d.split('.')[0]
    ret << v if !ret.include?(v)
  }
  ret
end

#domains_rows(_domains) ⇒ Object



1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
# File 'lib/a-core.rb', line 1386

def domains_rows(_domains)
  ret = Array.new
  if _domains
    _domains.each{|d|
      v = d.split('.')[0]
      ret << v if !ret.include?(v)
    }
  end
  ret
end

#find_splitted_frame(_start_frame) ⇒ Object



1741
1742
1743
1744
1745
1746
1747
# File 'lib/a-core.rb', line 1741

def find_splitted_frame(_start_frame)
  splitted_frame = _start_frame
  while splitted_frame != nil && !splitted_frame.kind_of?(AGTkSplittedFrames)
    splitted_frame = TkWinfo.parent(splitted_frame)
  end
  splitted_frame
end

#frame(_domain_name, _name) ⇒ Object



2240
2241
2242
# File 'lib/a-core.rb', line 2240

def frame(_domain_name, _name)
  @panels[_domain_name]['sons'][_name].frame
end

#headed?Boolean

Returns:

  • (Boolean)


1905
1906
1907
# File 'lib/a-core.rb', line 1905

def headed?
  @headed
end

#hide_panelObject



2233
2234
# File 'lib/a-core.rb', line 2233

def hide_panel
end

#max_col(_domains, _row) ⇒ Object



1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
# File 'lib/a-core.rb', line 1397

def max_col(_domains, _row)
  ret = 0
  if _domains
    _domains.each{|d|
      r,c = d.split('.')
      if r.to_i == _row && c.to_i > ret
        ret = c.to_i
      end
    }
  end
  ret
end

#max_row(_domains, _col) ⇒ Object



1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
# File 'lib/a-core.rb', line 1410

def max_row(_domains, _col)
  ret = 0
  if _domains
    _domains.each{|d|
      r,c = d.split('.')
      if c.to_i == _col && r.to_i > ret
        ret = r.to_i
      end
    }
  end
  ret
end

#new_float_frame(_args = nil) ⇒ Object



2256
2257
2258
2259
2260
2261
2262
2263
2264
# File 'lib/a-core.rb', line 2256

def new_float_frame(_args=nil)
  if _args.nil?
   _args = {'x'=>10, 'y'=>10, 'width'=>100, 'height'=>100}
  end
  _frame =  TkFloatTitledFrame.new(root)
  _frame.on_close=proc{_frame.hide}
  _frame.place(_args)
  return _frame
end

#process_frame(_ffw) ⇒ Object

def change_domain_old(_dom1, _dom2, _name2)

  tt1= @panels[_dom1]['root'].top_text
  tt2= @panels[_dom2]['root'].top_text
  if  @panels[_dom2]['sons'].length ==1 && @panels[_dom1]['sons'].length > 0
    # change ------
    ffw1 = raised_fixed_frame(_dom1)
    ffw2 = @panels[_dom2]['sons'].values[0]
    unregister_panel(ffw1,false,false) if ffw1
    unregister_panel(ffw2,false,false)
    ffw1.domain = _dom2 if ffw1
    ffw2.domain = _dom1
    register_panel(ffw1, ffw1.hinner_frame) if ffw1
    register_panel(ffw2, ffw2.hinner_frame)
    @panels[_dom1]['root'].top_text(tt2)
    @panels[_dom2]['root'].top_text(tt1)
  elsif @panels[_dom2]['sons'].length > 1
    ffw2 = @panels[_dom2]['sons'][_name2]
    unregister_panel(ffw2, false, false)
    ffw2.domain = _dom1
    register_panel(ffw2, ffw2.hinner_frame)
    @panels[_dom1]['root'].top_text(tt2)
    @panels[_dom2]['root'].top_text('')
  end
  # refresh -----
  build_invert_menu
end


1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
# File 'lib/a-core.rb', line 1979

def process_frame(_ffw)
#def process_frame(_domain_name, _frame_name)
  #domain_root = @panels[_domain_name]['sons'][_frame_name]
  @panels.keys.each{|dom|
    if  dom != '_domain_root_' && dom != _ffw.domain && @panels[dom] && @panels[dom]['root']
      menu = @panels[dom]['root'].menu_button('ext').cget('menu')
      menu.insert('0',:command,
            :label=>_ffw.title,
            :image=>TkPhotoImage.new('dat'=>ARROW_LEFT_GIF),
            :compound=>'left',
            :command=>proc{change_domain(dom, _ffw.name)},
            :hidemargin => true
      )
    end
  }
end

#raise_panel(_domain, _extension) ⇒ Object



1054
1055
1056
1057
1058
1059
1060
# File 'lib/a-core.rb', line 1054

def raise_panel(_domain, _extension)
   p = @panels[_domain]
   if p && p['notebook'] != nil
     p['notebook'].raise(_extension)
     p['notebook'].see(_extension)
   end
end

#raised?(_domain, _name) ⇒ Boolean

def raise_panel(_domain_name, _name)

  @panels[_domain_name]['notebook'].raise(_name) if @panels[_domain_name] && @panels[_domain_name]['notebook']
end

Returns:

  • (Boolean)


1066
1067
1068
1069
1070
1071
1072
1073
# File 'lib/a-core.rb', line 1066

def raised?(_domain, _name)
   ret = true
   p = @panels[_domain]
   if p && p['notebook'] != nil
     ret=p['notebook'].raise == _name
   end
   ret
end

#raised_fixed_frame(_domain) ⇒ Object



1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
# File 'lib/a-core.rb', line 1075

def raised_fixed_frame(_domain)
  ret = nil
  p = @panels[_domain]
   if p && p['notebook'] != nil
     raised_name=p['notebook'].raise
  	  @panels[_domain]['sons'].each{|k,v|
  	    if raised_name == k 
  	      ret = v 
  	      break
  	    end
  	  }
   elsif @panels[_domain]['sons'].length == 1
     ret = @panels[_domain]['sons'].values[0]
   end
   ret
end

#registed?(_domain_name, _name) ⇒ Boolean

Returns:

  • (Boolean)


1913
1914
1915
# File 'lib/a-core.rb', line 1913

def registed?(_domain_name, _name)
  @panels[_domain_name]['sons'][_name] != nil
end

#register_panel(_ffw, _adapter = nil) ⇒ Object

def register_panel_old(_domain_name, _name, _title)

  p = @panels[_domain_name]
  if p!=nil
    num = p['sons'].length
    if @headed
      p['root'].title(_title)
      if !p['root'].frame.instance_of?(TkFrameAdapter)
        wrapper = TkFrameAdapter.new(self.root, Arcadia.style('frame'))
        wrapper.attach_frame(p['root'].frame)
        p['root'].frame=wrapper
      end
      root_frame = p['root'].frame
      process_register_panel(_domain_name)
    else
      root_frame = p['root']
    end
    if (num == 0 && @autotab)
      api = ArcadiaPanelInfo.new(_name,_title,nil)
      api.frame = TkFrame.new(root_frame, Arcadia.style('panel')).place('x'=>0, 'y'=>0, 'relwidth'=>1, 'relheight'=>1)
      p['sons'][_name] = api
      return api.frame
    else
      if num == 1 && @autotab &&  p['notebook'] == nil
        p['notebook'] = Tk::BWidget::NoteBook.new(root_frame, Arcadia.style('tabpanel')){
          tabbevelsize 0
          internalborderwidth 0
          pack('fill'=>'both', :padx=>0, :pady=>0, :expand => 'yes')
        }
        api = p['sons'].values[0]
        api_tab_frame = p['notebook'].insert('end',
          api.name,
          'text'=>api.title,
          'raisecmd'=>proc{
					    p['root'].title(api.title)
					    p['root'].top_text('')            
             changed
            notify_observers('RAISE', api.name)
          }
        )
        api.frame.place('in'=>api_tab_frame, 'x'=>0, 'y'=>0, 'relwidth'=>1, 'relheight'=>1)
        api.frame.raise
      elsif (num==0 && !@autotab)
        p['notebook'] = Tk::BWidget::NoteBook.new(root_frame){
          tabbevelsize 0
          internalborderwidth 0
          pack('fill'=>'both', :padx=>0, :pady=>0, :expand => 'yes')
        }
      end
      _panel = p['notebook'].insert('end',_name , 
      		'text'=>_title, 
        'raisecmd'=>proc{

p.title(_title)

          changed
          notify_observers('RAISE', _name)
        }
      		)
      p['sons'][_name] = ArcadiaPanelInfo.new(_name,_title,_panel)
      p['notebook'].raise(_name)
      return _panel
    end
  else
    Arcadia.dialog(self, 
      'type'=>'ok',
      'msg'=>"domain #{_domain_name} do not exist\nfor '#{_title}'!",
      'level'=>'warning' 
    )
    float_frame = new_float_frame
    float_frame.title(_title)
    return float_frame.frame
  end
end


2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
# File 'lib/a-core.rb', line 2095

def register_panel(_ffw, _adapter=nil)
  _domain_name = _ffw.domain
  _name = _ffw.name
  _title = _ffw.title
  pan = @panels[_domain_name]
  @wrappers[_name]=_ffw
  if pan!=nil
    num = pan['sons'].length
    if @headed
      pan['root'].title(_title)
      if !pan['root'].frame.instance_of?(TkFrameAdapter) && num==0
        if _adapter
          adapter = _adapter
        else
          adapter = TkFrameAdapter.new(self.root, Arcadia.style('frame'))
        end
        adapter.attach_frame(pan['root'].frame)
        adapter.raise
        #@wrappers[_name]=wrapper
      end
      root_frame = pan['root'].frame
    else
      root_frame = pan['root']
    end
    if (num == 0 && @autotab)
      #api = ArcadiaPanelInfo.new(_name,_title,wrapper,_ffw)
      pan['sons'][_name] = _ffw
      process_frame(_ffw)
      return adapter
    else
      if num == 1 && @autotab &&  pan['notebook'] == nil
        pan['notebook'] = Tk::BWidget::NoteBook.new(root_frame, Arcadia.style('titletabpanel')){
          tabbevelsize 0
          internalborderwidth 0
          pack('fill'=>'both', :padx=>0, :pady=>0, :expand => 'yes')
        }
        api = pan['sons'].values[0]
        api_tab_frame = pan['notebook'].insert('end',
          api.name,
          'text'=>api.title,
          'raisecmd'=>proc{
					    pan['root'].title(api.title)
					    pan['root'].top_text('') 
       	     Arcadia.process_event(LayoutRaisingFrameEvent.new(self,'extension_name'=>_ffw.extension, 'frame_name'=>_ffw.name))

#               changed
#               notify_observers('RAISE', api.name)
          }
        )
        adapter = api.hinner_frame
        adapter.detach_frame
        adapter.attach_frame(api_tab_frame)
        api.hinner_frame.raise
      elsif (num==0 && !@autotab)
        pan['notebook'] = Tk::BWidget::NoteBook.new(root_frame, Arcadia.style('titletabpanel')){
          tabbevelsize 0
          internalborderwidth 0
          pack('fill'=>'both', :padx=>0, :pady=>0, :expand => 'yes')
        }
      end
      _panel = pan['notebook'].insert('end',_name , 
      		'text'=>_title, 
        'raisecmd'=>proc{
			  pan['root'].title(_title)            
    	     Arcadia.process_event(LayoutRaisingFrameEvent.new(self,'extension_name'=>_ffw.extension, 'frame_name'=>_ffw.name))
#            changed
#            notify_observers('RAISE', _name)
        }
      		)
      if _adapter
        adapter = _adapter
      else
        adapter = TkFrameAdapter.new(self.root, Arcadia.style('frame'))
      end
      adapter.attach_frame(_panel)
      adapter.raise
      _panel=adapter
      #@wrappers[_name]=wrapper
      #p['sons'][_name] = ArcadiaPanelInfo.new(_name,_title,_panel,_ffw)
      pan['sons'][_name] = _ffw
      pan['notebook'].raise(_name)
      process_frame(_ffw)
      return _panel
    end
  else
    _ffw.domain = nil
    process_frame(_ffw)
    return TkFrameAdapter.new(self.root, Arcadia.style('frame'))
    
#
#      Arcadia.dialog(self, 
#        'type'=>'ok',
#        'msg'=>"domain #{_domain_name} do not exist\nfor '#{_title}'!",
#        'level'=>'warning' 
#      )
#      float_frame = new_float_frame
#      float_frame.title(_title)
#      return float_frame.frame
  end
end

#rootObject



1050
1051
1052
# File 'lib/a-core.rb', line 1050

def root
	@panels['_domain_root_']['root']
end

#shift_bottom(_row, _col) ⇒ Object



1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
# File 'lib/a-core.rb', line 1295

def shift_bottom(_row, _col)
  d = domain_name(_row+1, _col)
  dj = domain_name(_row, _col)
  if @panels[d] !=nil
    shift_bottom(_row+1,_col)
  end
  Arcadia.console(self,'msg'=>"shifto giu #{dj} (su #{d})")
  @panels[d] = @panels[dj]
  #-------------------------------
  #@panels[d]['root'].set_domain(d)
  #-------------------------------
  @panels[d]['sons'].each{|name,ffw| ffw.domain=d}
  if @frames[_row + 1] == nil
  		@frames[_row + 1] = Array.new
  		@domains[_row + 1] = Array.new
  end
  @frames[_row+1][_col] = @frames[_row][_col]
  @domains[_row+1][_col] = @domains[_row][_col]
  
  @panels.delete(dj)
  #@panels[dj] = nil
  @frames[_row][_col] = nil
  @domains[_row][_col] = nil
end

#shift_left(_row, _col) ⇒ Object



1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
# File 'lib/a-core.rb', line 1251

def shift_left(_row,_col)
  d = domain_name(_row, _col)
  dj = domain_name(_row, _col+1)
  if @panels[dj] !=nil
    Arcadia.console(self,'msg'=>"shifto a sinista #{dj} (su #{d})")
    @panels[d] = @panels[dj]
    #-------------------------------
    #@panels[d]['root'].set_domain(d)
    #-------------------------------
    @panels[d]['sons'].each{|name,ffw| ffw.domain=d}
    @frames[_row][_col] = @frames[_row][_col+1]
    @domains[_row][_col] = @domains[_row][_col+1]
    
    @panels.delete(dj) # = nil
    @frames[_row][_col+1] = nil
    @domains[_row][_col+1] = nil
    shift_left(_row,_col+1)
  end

end

#shift_right(_row, _col) ⇒ Object



1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
# File 'lib/a-core.rb', line 1230

def shift_right(_row,_col)
  d = domain_name(_row, _col+1)
  dj = domain_name(_row, _col)
  if @panels[d] !=nil
    shift_right(_row,_col+1)
  end
  Arcadia.console(self,'msg'=>"shifto a destra #{dj} (su #{d})")
  @panels[d] = @panels[dj]
  #-------------------------------
  #@panels[d]['root'].set_domain(d)
  #-------------------------------
  @panels[d]['sons'].each{|name,ffw| ffw.domain=d}
  @frames[_row][_col+1] = @frames[_row][_col]
  @domains[_row][_col+1] = @domains[_row][_col]
  
  @panels.delete(dj)
  #@panels[dj] = nil
  @frames[_row][_col] = nil
  @domains[_row][_col] = nil
end

#shift_top(_row, _col) ⇒ Object



1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
# File 'lib/a-core.rb', line 1272

def shift_top(_row,_col)
  d = domain_name(_row, _col)
  dj = domain_name(_row+1, _col)
  if @panels[dj] !=nil
    Arcadia.console(self,'msg'=>"shifto su #{dj} (su #{d})")
    @panels[d] = @panels[dj]
    #-------------------------------
    #@panels[d]['root'].set_domain(d)
    #-------------------------------
    @panels[d]['sons'].each{|name,ffw| ffw.domain=d}
    @frames[_row][_col] = @frames[_row+1][_col]
    @domains[_row][_col] = @domains[_row+1][_col]
    
    @panels.delete(dj) # = nil
    @frames[_row+1][_col] = nil
    @domains[_row+1][_col] = nil

    shift_top(_row+1,_col)
  end

end

#unbuild_titled_frame(domain) ⇒ Object



1838
1839
1840
1841
1842
1843
1844
# File 'lib/a-core.rb', line 1838

def unbuild_titled_frame(domain)
  if @panels[domain]
    parent = @panels[domain]['root'].parent
    @panels[domain]['root'].destroy
    @panels[domain]['root']=parent
  end
end

#unregister_panel(_ffw, delete_wrapper = true, refresh_menu = true) ⇒ Object



2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
# File 'lib/a-core.rb', line 2197

def unregister_panel(_ffw, delete_wrapper=true, refresh_menu=true)
  #p "unregister #{_name} ------> 1"
  _domain_name = _ffw.domain
  _name = _ffw.name
  @panels[_domain_name]['sons'][_name].hinner_frame.detach_frame
  if delete_wrapper
    @wrappers.delete(_name).hinner_frame.destroy 
  else
    @wrappers[_name].domain=nil
  end
  @panels[_domain_name]['sons'].delete(_name)
  #p "unregister #{_name} ------> 2"
  if @panels[_domain_name]['sons'].length == 1
    w = @panels[_domain_name]['sons'].values[0].hinner_frame
    t = @panels[_domain_name]['sons'].values[0].title
    w.detach_frame
    w.attach_frame(@panels[_domain_name]['root'].frame)
    @panels[_domain_name]['root'].title(t)
    @panels[_domain_name]['notebook'].destroy
    @panels[_domain_name]['notebook']=nil
  elsif @panels[_domain_name]['sons'].length > 1
    @panels[_domain_name]['notebook'].delete(_name) if @panels[_domain_name]['notebook'].index(_name) > 0
    #p "unregister #{_name} ------> 3"
    new_raise_key = @panels[_domain_name]['sons'].keys[@panels[_domain_name]['sons'].length-1]
    #p "unregister #{_name} ------> 4"
    @panels[_domain_name]['notebook'].raise(new_raise_key)
    #p "unregister #{_name} ------> 5"
  elsif @panels[_domain_name]['sons'].length == 0
    @panels[_domain_name]['root'].title('')
  end
  build_invert_menu if refresh_menu
end

#view_panelObject



2230
2231
# File 'lib/a-core.rb', line 2230

def view_panel
end