예제 #1
0
//---------------------------------------------------------------------------------------
LangOptionsPanel::LangOptionsPanel(wxWindow* parent, ApplicationScope& appScope)
    : OptionsPanel(parent, appScope)
{
    create_controls();

    //load icon
    m_pTitleIcon->SetBitmap( wxArtProvider::GetIcon("opt_language", wxART_TOOLBAR, wxSize(24,24)) );

    //Get current selected language
    wxConfigBase* pPrefs = m_appScope.get_preferences();
    m_sCurLang = pPrefs->Read("/Locale/Language", "en");

    // Get array of available languages
    GetLanguages(m_cLangCodes, m_cLangNames);
    int nNumLangs = m_cLangNames.GetCount();
    m_pChoice->Append(m_cLangNames);

    //select current language
    m_pChoice->SetSelection(0);         //default selection
    int i;
    for(i=0; i < nNumLangs; i++) {
        if (m_cLangCodes[i] == m_sCurLang)
            m_pChoice->SetSelection(i);
    }

}
예제 #2
0
/**
 * \brief Constructor.
 * \param parent Parent window.
 */
bf::frame_duration_dialog::frame_duration_dialog( wxWindow* parent )
  : wxDialog(parent, wxID_ANY, wxT("Change frame durations"), wxDefaultPosition,
             wxDefaultSize)
{
  create_controls();
  Fit();
} // frame_duration_dialog::frame_duration_dialog()
예제 #3
0
//---------------------------------------------------------------------------------------
void IdfyTonalityCtrol::initialize_ctrol()
{
    m_pConstrains = dynamic_cast<TonalityConstrains*>(m_pBaseConstrains);
    m_pConstrains->set_height(4000.0);      //minimum problem box height = 40mm

    create_controls();
}
예제 #4
0
/**
 * \brief Constructor.
 * \param parent The window owning this dialog.
 */
bf::config_frame::config_frame( wxWindow* parent )
  : wxDialog( parent, wxID_ANY, _("Configuration"), wxDefaultPosition, 
             wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{
  create_controls();
  Fit();
} // config_frame::config_frame()
예제 #5
0
void Engine::do_turn( int allegiance ){
	AI* ai = new AI( world );
	Round* r = ai->create_round( allegiance );
	create_controls( r );
	delete ai;
	set_turn( 0 );
}
예제 #6
0
/**
 * \brief Constructor.
 * \param parent The window owning this window.
 */
bf::level_properties_frame::level_properties_frame( wxWindow* parent )
  : wxDialog(parent, wxID_ANY, wxString(_("Level properties"))),
    m_width(s_min_width), m_height(s_min_height)
{
  create_controls();
  Fit();
} // level_properties_frame::level_properties_frame()
예제 #7
0
int
main(int argc, char** argv)
{
  GError* error = NULL;
  GConfClient* client = NULL;

  gtk_init(&argc, &argv);
  
  if (!gconf_init(argc, argv, &error))
    {
      g_assert(error != NULL);
      g_warning("GConf init failed:\n  %s", error->message);
      return 1;
    }

  g_assert(error == NULL);

  client = gconf_client_get_default();

  gconf_client_add_dir(client, "/apps/gnome/testgconfclient", GCONF_CLIENT_PRELOAD_NONE, NULL);

  create_controls(client);
  
  gtk_main();

  g_object_unref(G_OBJECT(client));
  
  return 0;
}
예제 #8
0
/**
 * \brief Constructor.
 * \param parent The parent window.
 */
bf::clone_selection_dialog::clone_selection_dialog( wxWindow& parent )
  : wxDialog( &parent, wxID_ANY, wxString(_("Clone selection")) )
{
  create_controls();
  create_sizers();

  Fit();
} // clone_selection_dialog::clone_selection_dialog()
예제 #9
0
파일: erasure.c 프로젝트: aneeshd/ctcp
int main( int   argc,
          char *argv[] )
{
    gtk_init (&argc, &argv);
    create_controls ();
    gtk_main ();
    return 0;
}
예제 #10
0
/**
 * \brief Constructor.
 * \param parent The window owning this window.
 * \param g A grid in which we take the initial values.
 */
bf::grid_properties_frame::grid_properties_frame
( wxWindow* parent, const grid& g )
  : wxDialog(parent, wxID_ANY, wxString(_("Grid parameters"))), m_grid(g)
{
  create_controls();
  fill_controls();
  Fit();
} // grid_properties_frame::grid_properties_frame()
예제 #11
0
/**
 * \brief Constructor.
 * \param parent The window owning this window.
 * \param v The initial animation.
 */
bf::animation_file_edit::animation_file_edit
( wxWindow& parent, const animation_file_type& v )
  : wxPanel(&parent, wxID_ANY), base_edit<animation_file_type>(v)
{
  create_controls();
  value_updated();
  Fit();
} // animation_file_edit::animation_file_edit()
예제 #12
0
/**
 * \brief Constructor.
 * \param owning_layer The layer onwing the window.
 * \param use_loading Tell if we use the "loading" level.
 * \param playability Indicates the number of required players.
 */
ptb::frame_start_menu::frame_start_menu
( windows_layer* owning_layer, bool use_loading,
  playability_type::value_type playability )
  : menu_frame(owning_layer, gettext("Start game")),
    m_use_loading(use_loading), m_playability(playability)
{
  create_controls();
} // frame_start_menu::frame_start_menu()
예제 #13
0
/**
 * \brief Constructor.
 * \param parent The window owning this window.
 * \param m The model edited.
 */
bf::action_properties_frame::action_properties_frame
( wxWindow* parent, const gui_model* m )
  : wxDialog(parent, wxID_ANY, wxString(_("Action properties"))), m_model(m),
    m_duration(1)
{
  create_controls();
  Fit();
} // action_properties_frame::action_properties_frame()
예제 #14
0
/**
 * \brief Default constructor.
 * \param env The workspace environment.
 */
bf::main_frame::main_frame( const workspace_environment& env )
: wxFrame(NULL, wxID_ANY, wxT("Bear Factory - Animation editor")),
  m_workspace(env)
{
  create_menu();
  create_toolbar();
  create_controls();
  Fit();
} // main_frame::main_frame()
예제 #15
0
/**
 * \brief Constructor.
 * \param parent The frame owning this one.
 * \param env The workspace environment to use.
 */
bf::mark_list_frame::mark_list_frame
( wxWindow* parent, workspace_environment* env )
  : wxPanel( parent ), m_model_frame(NULL), m_mark_list(NULL),
    m_new_mark_button(NULL), m_delete_mark_button(NULL),
    m_properties_mark_button(NULL), m_workspace(env)
{
  create_controls();
  update_controls();
} // mark_list_frame::mark_list_frame()
예제 #16
0
/**
 * \brief Constructor.
 * \param parent The parent window.
 * \param env The workspace environment to use.
 * \param spr The sprite to display.
 */
bf::sprite_view_ctrl::sprite_view_ctrl
( wxWindow& parent, workspace_environment& env, const sprite& spr )
    : wxPanel(&parent), m_sprite_view(NULL), m_workspace(env)
{
    create_controls();
    create_sizers();
    set_sprite(spr);

    m_combo_zoom->SetSelection( m_combo_zoom->FindString(wxT("100")) );
    adjust_scrollbars();
} // sprite_view_ctrl::sprite_view_ctrl()
예제 #17
0
//---------------------------------------------------------------------------------------
void IdfyScalesCtrol::initialize_ctrol()
{
    m_pConstrains = dynamic_cast<ScalesConstrains*>(m_pBaseConstrains);
    m_pConstrains->set_height(4000.0);      //minimum problem box height = 40mm

    //initializatios to allow to play scales
    m_nKey = k_key_C;
    m_fAscending = m_pConstrains->GetRandomPlayMode();

    create_controls();
}
예제 #18
0
Options( ConvolveInst *inst )
{
   panel = PAN_CREATE( panf, "Convolve" );
   if ( !panel )
      return "Convolve couldn't create its panel, not sure why.";

   create_controls( inst );
   panf->open( panel, PANF_BLOCKING );

   PAN_KILL( panf, panel );

   return NULL;
}
예제 #19
0
/**
 * \brief Constructor.
 * \param owning_layer The layer onwing the window.
 */
ptb::frame_play_story::frame_play_story
( windows_layer* owning_layer )
  : frame(owning_layer, gettext("Level selection")), m_index(0)
{
  load_and_sort_level_names();
  create_controls();

  for ( unsigned int i=0; i != m_levels.size(); ++i)
    CLAW_PRECOND( m_levels[i].is_valid() );

  m_index = m_levels.size() - 1;

  update_controls();
} // frame_play_story::frame_play_story()
예제 #20
0
/**
 * \brief Default constructor.
 */
bf::main_frame::main_frame()
  : wxFrame(NULL, wxID_ANY, wxT("Bear Factory - Model editor")),
    m_model_properties(NULL), m_windows_layout(NULL)
{
  SetSize( wxGetApp().get_config().main_rect );

  create_menu();
  create_controls();
  turn_model_entries(false);

  m_windows_layout = new windows_layout(*this);

  Show();
} // main_frame::main_frame()
예제 #21
0
파일: mixer.cpp 프로젝트: antico/osso
Mixer::Mixer(QWidget * parent) : QMainWindow(parent)
{
    setWindowTitle(tr("Osso - OSS 4.1 Mixer"));
    setWindowIcon(QIcon(":/icons/osso.png"));
    init();
    set_childs();
    create_controls();
    create_docks();
    create_menu();
    merge_childs();
    create_systray_actions();
    create_systray_icon();
    find_master();
    trayIcon->show();
}
예제 #22
0
void
rb_visualizer_fullscreen_add_widgets (GtkWidget *window, ClutterActor *stage, RBShell *shell)
{
    ClutterActor *track_info;
    ClutterActor *controls;
    GdkScreen *screen;
    GdkRectangle geom;
    int x;
    int y;
    int monitor;

    clutter_threads_enter ();

    /* get geometry for the monitor we're going to appear on */
    screen = gtk_widget_get_screen (window);
    monitor = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (window));
    gdk_screen_get_monitor_geometry (screen, monitor, &geom);

    /* create and place the track info display */
    track_info = create_track_info (shell);

    clutter_container_add_actor (CLUTTER_CONTAINER (stage), track_info);
    g_object_set_data (G_OBJECT (stage), TRACK_INFO_DATA, track_info);

    /* XXX rtl? */
    clutter_actor_set_position (track_info, FULLSCREEN_BORDER_WIDTH, FULLSCREEN_BORDER_WIDTH);

    /* create and place the playback controls */
    controls = create_controls (shell);
    clutter_container_add_actor (CLUTTER_CONTAINER (stage), controls);
    g_object_set_data (G_OBJECT (stage), CONTROLS_DATA, controls);

    /* put this bit somewhere near the bottom */
    /* XXX rtl */
    x = FULLSCREEN_BORDER_WIDTH;
    y = geom.height - (clutter_actor_get_height (controls) + FULLSCREEN_BORDER_WIDTH);
    clutter_actor_set_position (controls, x, y);

    /* hide mouse cursor when not moving, hide playback controls when mouse not moving
     * and outside them
     */
    g_signal_connect_object (stage, "motion-event", G_CALLBACK (stage_motion_event_cb), controls, 0);
    g_signal_connect (controls, "leave-event", G_CALLBACK (controls_leave_event_cb), NULL);
    g_signal_connect (controls, "enter-event", G_CALLBACK (controls_enter_event_cb), NULL);
    start_hide_timer (controls);

    clutter_threads_leave ();
}
예제 #23
0
파일: window.c 프로젝트: DimondTheCat/xray
int open_window( GlobalFunc *global )
{
   int i;

   natorder = native_order();

   msgf    = global( LWMESSAGEFUNCS_GLOBAL, GFUSE_TRANSIENT );
   filereq = global( LWFILEREQFUNC_GLOBAL,  GFUSE_TRANSIENT );
   rasf    = global( LWRASTERFUNCS_GLOBAL,  GFUSE_TRANSIENT );
   panf    = global( LWPANELFUNCS_GLOBAL,   GFUSE_TRANSIENT );
   if ( !msgf || !filereq || !rasf || !panf )
      return AFUNC_BADGLOBAL;

   panf->globalFun = global;

   if( !( panel = PAN_CREATE( panf, PANEL_TITLE ))) {
      msgf->error( PLUGIN_NAME " couldn't create its panel,", "not sure why." );
      return AFUNC_OK;
   }

   panf->set( panel, PAN_USERKEYS, handle_key );
   panf->set( panel, PAN_USEROPEN, handle_panopen );

   cras[ 0 ] = create_char( COLOR_WHITE, SYSTEM_Ic( 30 ), rasf );
   cras[ 1 ] = create_char( COLOR_BLACK, SYSTEM_Ic(  2 ), rasf );
   cras[ 2 ] = create_char( COLOR_BLACK, SYSTEM_Ic( 15 ), rasf );

   create_controls();
   panf->open( panel, PANF_BLOCKING );

   PAN_KILL( panf, panel );

   for ( i = 0; i < 3; i++ )
      free_char( cras[ i ], rasf );
   free_icon( rasf );

   return AFUNC_OK;
}
예제 #24
0
/**
 * \brief Constructor.
 * \param parent The frame owning this one.
 */
bf::snapshot_frame::snapshot_frame( wxWindow* parent )
  : wxPanel( parent ), m_model_frame(NULL), m_snapshot(NULL)
{
  create_controls();
} // snapshot_frame::snapshot_frame()
예제 #25
0
/*
 * This function is the configuration box.
 * (Being a dialog procedure, in general it returns 0 if the default
 * dialog processing should be performed, and 1 if it should not.)
 */
static INT_PTR CALLBACK
config_dialog_proc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
  switch (msg) {
    when WM_INITDIALOG: {
      ctrlbox = ctrl_new_box();
      setup_config_box(ctrlbox);
      windlg_init();
      winctrl_init(&ctrls_base);
      winctrl_init(&ctrls_panel);
      windlg_add_tree(&ctrls_base);
      windlg_add_tree(&ctrls_panel);
      copy_config("dialog", &new_cfg, &file_cfg);

      RECT r;
      GetWindowRect(GetParent(wnd), &r);
      dlg.wnd = wnd;

     /*
      * Create the actual GUI widgets.
      */
      // here we need the correct DIALOG_HEIGHT already
      create_controls(wnd, "");        /* Open and Cancel buttons etc */

      SendMessage(wnd, WM_SETICON, (WPARAM) ICON_BIG,
                  (LPARAM) LoadIcon(inst, MAKEINTRESOURCE(IDI_MAINICON)));

     /*
      * Create the tree view.
      */
      r.left = 3;
      r.right = r.left + 64;
      r.top = 3;
      r.bottom = r.top + DIALOG_HEIGHT - 26;
      MapDialogRect(wnd, &r);
      HWND treeview =
        CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, "",
                       WS_CHILD | WS_VISIBLE | WS_TABSTOP | TVS_HASLINES |
                       TVS_DISABLEDRAGDROP | TVS_HASBUTTONS | TVS_LINESATROOT
                       | TVS_SHOWSELALWAYS, r.left, r.top, r.right - r.left,
                       r.bottom - r.top, wnd, (HMENU) IDCX_TREEVIEW, inst,
                       null);
      WPARAM font = SendMessage(wnd, WM_GETFONT, 0, 0);
      SendMessage(treeview, WM_SETFONT, font, MAKELPARAM(true, 0));
      treeview_faff tvfaff;
      tvfaff.treeview = treeview;
      memset(tvfaff.lastat, 0, sizeof (tvfaff.lastat));

     /*
      * Set up the tree view contents.
      */
      HTREEITEM hfirst = null;
      char *path = null;

      for (int i = 0; i < ctrlbox->nctrlsets; i++) {
        controlset *s = ctrlbox->ctrlsets[i];
        HTREEITEM item;
        int j;
        char *c;

        if (!s->pathname[0])
          continue;
        j = path ? ctrl_path_compare(s->pathname, path) : 0;
        if (j == INT_MAX)
          continue;   /* same path, nothing to add to tree */

       /*
        * We expect never to find an implicit path
        * component. For example, we expect never to see
        * A/B/C followed by A/D/E, because that would
        * _implicitly_ create A/D. All our path prefixes
        * are expected to contain actual controls and be
        * selectable in the treeview; so we would expect
        * to see A/D _explicitly_ before encountering
        * A/D/E.
        */

        c = strrchr(s->pathname, '/');
        if (!c)
          c = s->pathname;
        else
          c++;

        item = treeview_insert(&tvfaff, j, c, s->pathname);
        if (!hfirst)
          hfirst = item;

        path = s->pathname;

       /*
        * Put the treeview selection on to the Session panel.
        * This should also cause creation of the relevant
        * controls.
        */
        TreeView_SelectItem(treeview, hfirst);
      }

     /*
      * Set focus into the first available control.
      */
      for (winctrl *c = ctrls_panel.first; c; c = c->next) {
        if (c->ctrl) {
          dlg_set_focus(c->ctrl);
          break;
        }
      }
    }

    when WM_DESTROY:
      winctrl_cleanup(&ctrls_base);
      winctrl_cleanup(&ctrls_panel);
      ctrl_free_box(ctrlbox);
      config_wnd = 0;

    when WM_NOTIFY: {
      if (LOWORD(wParam) == IDCX_TREEVIEW &&
          ((LPNMHDR) lParam)->code == TVN_SELCHANGED) {
        HTREEITEM i = TreeView_GetSelection(((LPNMHDR) lParam)->hwndFrom);
        TVITEM item;
        char buffer[64];

        item.hItem = i;
        item.pszText = buffer;
        item.cchTextMax = sizeof (buffer);
        item.mask = TVIF_TEXT | TVIF_PARAM;
        TreeView_GetItem(((LPNMHDR) lParam)->hwndFrom, &item);

       /* Destroy all controls in the currently visible panel. */
        for (winctrl *c = ctrls_panel.first; c; c = c->next) {
          for (int k = 0; k < c->num_ids; k++) {
            HWND item = GetDlgItem(wnd, c->base_id + k);
            if (item)
              DestroyWindow(item);
          }
        }
        winctrl_cleanup(&ctrls_panel);

        // here we need the correct DIALOG_HEIGHT already
        create_controls(wnd, (char *) item.lParam);
        dlg_refresh(null); /* set up control values */
      }
    }

    when WM_CLOSE:
      DestroyWindow(wnd);

    when WM_COMMAND or WM_DRAWITEM: {
      int ret = winctrl_handle_command(msg, wParam, lParam);
      if (dlg.ended)
        DestroyWindow(wnd);
      return ret;
    }

    when WM_USER: {
      HWND target = (HWND)wParam;
      // could delegate this to winctrls.c, like winctrl_handle_command;
      // but then we'd have to fiddle with the location of dragndrop
     /*
      * Look up the window handle in our data; find the control.
        (Hmm, apparently it works without looking for the widget entry 
        that was particularly introduced for this purpose...)
      */
      control * ctrl = null;
      for (winctrl *c = ctrls_panel.first; c && !ctrl; c = c->next) {
        if (c->ctrl)
          for (int k = 0; k < c->num_ids; k++) {
#ifdef debug_dragndrop
            printf(" [->%8p] %8p\n", target, GetDlgItem(wnd, c->base_id + k));
#endif
            if (target == GetDlgItem(wnd, c->base_id + k)) {
              ctrl = c->ctrl;
              break;
            }
        }
      }
      if (ctrl) {
        //dlg_editbox_set_w(ctrl, L"Test");  // may hit unrelated items...
        // drop the drag-and-drop contents here
        dragndrop = (wstring)lParam;
        ctrl->handler(ctrl, EVENT_DROP);
      }
    }
  }
  return 0;
}
예제 #26
0
/**
 * \brief Constructor.
 * \param owning_layer The layer onwing the window.
 */
ptb::frame_configure::frame_configure( windows_layer* owning_layer )
  : menu_frame(owning_layer, gettext("Configuration"))
{
  create_controls();
} // frame_configure::frame_configure()
예제 #27
0
/**
 * \brief Constructor.
 * \param owning_layer The layer onwing the window.
 */
ptb::frame_pause::frame_pause( windows_layer* owning_layer )
  : menu_frame(owning_layer, gettext("Pause")), m_msg_result(0)
{
  get_layer().get_level().set_pause();
  create_controls();
} // frame_pause::frame_pause()
static void set_view_mode(enum view_mode m)
{
	view_mode = m;
	create_controls();
}
예제 #29
0
/**
 * \brief Default constructor.
 * \param parent The parent window.
 */
bf::model_properties_ctrl::model_properties_ctrl( wxWindow* parent )
  : wxNotebook(parent, wxID_ANY)
{
  create_controls();
} // model_properties_ctrl::model_properties_ctrl()
예제 #30
0
/**
 * \brief Constructor.
 * \param owning_layer The layer owning the window.
 */
ptb::frame_profiles::frame_profiles( windows_layer* owning_layer )
  : frame(owning_layer, gettext("Profiles")), m_msg_result(0)
{
  create_controls();
} // frame_profiles::frame_profiles()