1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
"""
@package gmodeler.frame
@brief wxGUI Graphical Modeler for creating, editing, and managing models
Classes:
- frame::ModelerFrame
(C) 2010-2023 by the GRASS Development Team
This program is free software under the GNU General Public License
(>=v2). Read the file COPYING that comes with GRASS for details.
@author Martin Landa <landa.martin gmail.com>
@author Python exports Ondrej Pesek <pesej.ondrek gmail.com>
"""
import os
import wx
from core import globalvar
from gui_core.menu import Menu as Menubar
from gmodeler.menudata import ModelerMenuData
from gmodeler.panels import ModelerPanel
class ModelerFrame(wx.Frame):
def __init__(
self, parent, giface, id=wx.ID_ANY, title=_("Graphical Modeler"), **kwargs
):
"""Graphical modeler main window
:param parent: parent window
:param giface: GRASS interface
:param id: window id
:param title: window title
:param kwargs: wx.Frames' arguments
"""
wx.Frame.__init__(self, parent=parent, id=id, title=title, **kwargs)
self.SetIcon(
wx.Icon(os.path.join(globalvar.ICONDIR, "grass.ico"), wx.BITMAP_TYPE_ICO)
)
self.statusbar = self.CreateStatusBar(number=1)
self.panel = ModelerPanel(parent=self, giface=giface, statusbar=self.statusbar)
self.menubar = Menubar(
parent=self,
model=ModelerMenuData().GetModel(separators=True),
class_handler=self.panel,
)
self.SetMenuBar(self.menubar)
self.SetName("ModelerFrame")
self.SetMinSize((640, 300))
self.SetSize((800, 600))
|