J
J
julien_sorel2015-06-09 16:35:27
Programming
julien_sorel, 2015-06-09 16:35:27

How to switch different screen modes in an application, C++?

I really need help. I hope the problem is more or less clearly described:
There is an application, openframeworks, C ++.
Now draws both a list of links ( drawlist() ) and a graph ( drawscene () ).
It is necessary that at first only a list is displayed, and when you press tabulation, it changes to a graph. and so on, so that, in short, with tabulation each time either a list or a graph. Roughly speaking - two interface modes.
In theory, you need to do something with bool (false / true) .
part of code:

Dock.h:

List list;
List listFilter;
bool listFilterMode;

Dock.ccp:

void Dock::draw(){
.........
............
if(listFilterMode) listFilter.drawlist();
else list.drawlist();

drawScene();

}

void Dock::keyPress(int key){
if (key == OF_KEY_TAB)


}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
robotzet, 2015-06-09
@robotzet

void Dock::draw()
{
  ...
  if(listFilterMode)
  {
      listFilter.drawlist();
      listFilterMode = false;
  }
  else
  {
      list.drawList();
      listFilterMode = true;
  }

  drawScene();
}

void Dock::keyPress(int key)
{
  if(key == OF_KEY_TAB)
  {
     draw();
  }
}

I guess you need something like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question