diff --git a/GCR_CMake b/GCR_CMake index c39fdec..6ea69ec 160000 --- a/GCR_CMake +++ b/GCR_CMake @@ -1 +1 @@ -Subproject commit c39fdece33041c8028acc6cb90455019c35dae17 +Subproject commit 6ea69eca6817aead20a2cb87cdd08ab8e9a173cd diff --git a/Gtkmm3/CMakeLists.txt b/Gtkmm3/CMakeLists.txt index d9c4087..f56483a 100644 --- a/Gtkmm3/CMakeLists.txt +++ b/Gtkmm3/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_STANDARD 17) cmake_minimum_required(VERSION 3.0.0) -project(My_GtkUI VERSION 3.3.0) +project(My_GtkUI VERSION 3.4.0) include(CTest) enable_testing() @@ -34,6 +34,13 @@ add_custom_command( ${GRESOURCE_XML} --target=${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C} --generate-source + DEPENDS + ${CMAKE_SOURCE_DIR}/res/appmenu.xml + ${CMAKE_SOURCE_DIR}/res/game1.ui + ${CMAKE_SOURCE_DIR}/res/leftpanel.ui + ${CMAKE_SOURCE_DIR}/res/main_stack.ui + ${CMAKE_SOURCE_DIR}/res/toppanel.ui + ${CMAKE_SOURCE_DIR}/res/win_size.ui ) # Step 3: diff --git a/Gtkmm3/src/MyWin.cc b/Gtkmm3/src/MyWin.cc index 4db468b..e109158 100644 --- a/Gtkmm3/src/MyWin.cc +++ b/Gtkmm3/src/MyWin.cc @@ -144,7 +144,7 @@ void MyWin::about_dialog(){ std::vector authors; authors.push_back("Dale Clack"); //Create Comments - version=g_strdup_printf("3.3\nRunning against Gtkmm %d.%d.%d", + version=g_strdup_printf("3.4\nRunning against Gtkmm %d.%d.%d", GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION); diff --git a/Gtkmm3/src/TopPanel.cc b/Gtkmm3/src/TopPanel.cc index 41dec58..9d6ee90 100644 --- a/Gtkmm3/src/TopPanel.cc +++ b/Gtkmm3/src/TopPanel.cc @@ -4,12 +4,17 @@ TopPanel::TopPanel(): Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,5), -time_label("21:00:00 2021/6/13"), timer_value(1000) { //Initalize Timer mytimer=Glib::signal_timeout().connect(sigc::mem_fun(*this,&TopPanel::on_timeout),timer_value); - pack_start(time_label,Gtk::PACK_SHRINK); + time_btn.set_relief(Gtk::RELIEF_NONE); + time_btn.set_label("18:13:00 2021/11/17"); + time_btn.set_popover(time_popover); + time_popover.add(calender); + calender.set_size_request(300,250); + calender.show(); + pack_start(time_btn,Gtk::PACK_SHRINK); //Initalize menu menu_builder=Gtk::Builder::create_from_resource("/GtkUI/appmenu.xml"); @@ -44,6 +49,6 @@ bool TopPanel::on_timeout(){ //Show time sprintf(time_string,"%02d:%02d:%02d %04d/%02d/%02d", local->tm_hour,local->tm_min,local->tm_sec,local->tm_year+1900,local->tm_mon+1,local->tm_mday); - time_label.set_label(time_string); + time_btn.set_label(time_string); return true; } diff --git a/Gtkmm3/src/TopPanel.hh b/Gtkmm3/src/TopPanel.hh index 5b3b1a4..bd5731d 100644 --- a/Gtkmm3/src/TopPanel.hh +++ b/Gtkmm3/src/TopPanel.hh @@ -16,10 +16,13 @@ private: Glib::RefPtr menu_builder; //Timer sigc::connection mytimer; - Gtk::Label time_label; + Gtk::MenuButton time_btn; const int timer_value; bool on_timeout(); char time_string[57]; + //Calander + Gtk::Popover time_popover; + Gtk::Calendar calender; //Other Things Glib::RefPtr panel_builder; Gtk::VolumeButton *volume1;