Skip to content

Commit

Permalink
Add Calander
Browse files Browse the repository at this point in the history
  • Loading branch information
daleclack committed Nov 7, 2021
1 parent cdffab9 commit d635c39
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion GCR_CMake
Submodule GCR_CMake updated 58 files
+19 −0 .github/workflows/test.yml
+2 −2 README.md
+13 −12 macros/CompileGResources.cmake
+1 −0 tests/basic/.gitignore
+20 −0 tests/basic/CMakeLists.txt
+1 −0 tests/basic/assets/resource1.txt
+1 −0 tests/basic/assets/resource2.txt
+ tests/basic/snapshots/resources.gresource
+1 −0 tests/basic/snapshots/resources.gresource.xml
+1 −0 tests/compress-all/.gitignore
+21 −0 tests/compress-all/CMakeLists.txt
+1 −0 tests/compress-all/assets/resource1.txt
+1 −0 tests/compress-all/assets/resource2.txt
+ tests/compress-all/snapshots/resources.gresource
+1 −0 tests/compress-all/snapshots/resources.gresource.xml
+1 −0 tests/create-c-code/.gitignore
+20 −0 tests/create-c-code/CMakeLists.txt
+1 −0 tests/create-c-code/assets/resource1.txt
+1 −0 tests/create-c-code/assets/resource2.txt
+206 −0 tests/create-c-code/snapshots/resources.c
+1 −0 tests/create-c-code/snapshots/resources.gresource.xml
+1 −0 tests/custom-target/.gitignore
+21 −0 tests/custom-target/CMakeLists.txt
+1 −0 tests/custom-target/assets/resource.txt
+ tests/custom-target/snapshots/custom-resources.gresource
+1 −0 tests/custom-target/snapshots/resources.gresource.xml
+1 −0 tests/extended/.gitignore
+25 −0 tests/extended/CMakeLists.txt
+1 −0 tests/extended/assets/resource1.txt
+1 −0 tests/extended/assets/resource2.txt
+12 −0 tests/extended/assets/resource3.xml
+ tests/extended/assets/resource4.jpg
+ tests/extended/assets/resource5.jpg
+ tests/extended/snapshots/resources.gresource
+1 −0 tests/extended/snapshots/resources.gresource.xml
+1 −0 tests/source-dir-absolute/.gitignore
+22 −0 tests/source-dir-absolute/CMakeLists.txt
+1 −0 tests/source-dir-absolute/assets/resource.txt
+ tests/source-dir-absolute/snapshots/resources.gresource
+1 −0 tests/source-dir-absolute/snapshots/resources.gresource.xml
+1 −0 tests/source-dir-relative/.gitignore
+22 −0 tests/source-dir-relative/CMakeLists.txt
+1 −0 tests/source-dir-relative/assets/resource.txt
+ tests/source-dir-relative/snapshots/resources.gresource
+1 −0 tests/source-dir-relative/snapshots/resources.gresource.xml
+1 −0 tests/stripblanks-all/.gitignore
+21 −0 tests/stripblanks-all/CMakeLists.txt
+12 −0 tests/stripblanks-all/assets/resource1.xml
+12 −0 tests/stripblanks-all/assets/resource2.xml
+ tests/stripblanks-all/snapshots/resources.gresource
+1 −0 tests/stripblanks-all/snapshots/resources.gresource.xml
+154 −0 tests/test.bats
+1 −0 tests/topixdata-all/.gitignore
+21 −0 tests/topixdata-all/CMakeLists.txt
+ tests/topixdata-all/assets/resource1.jpg
+ tests/topixdata-all/assets/resource2.jpg
+ tests/topixdata-all/snapshots/resources.gresource
+1 −0 tests/topixdata-all/snapshots/resources.gresource.xml
9 changes: 8 additions & 1 deletion Gtkmm3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Gtkmm3/src/MyWin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void MyWin::about_dialog(){
std::vector<Glib::ustring> 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);
Expand Down
11 changes: 8 additions & 3 deletions Gtkmm3/src/TopPanel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
}
5 changes: 4 additions & 1 deletion Gtkmm3/src/TopPanel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ private:
Glib::RefPtr<Gtk::Builder> 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<Gtk::Builder> panel_builder;
Gtk::VolumeButton *volume1;
Expand Down

0 comments on commit d635c39

Please sign in to comment.