修改项目结构,更换程序入口为根目录下main.c

This commit is contained in:
JZYFC 2021-12-22 20:12:39 +08:00
parent 2287744230
commit 7a59db289b
12 changed files with 67 additions and 107 deletions

View File

@ -20,7 +20,7 @@ add_library(ConsoleLib "console/ConsoleSettings.c" "console/ConsoleSettings.h" i
add_library(GuiLib "gui/WndUtil.h" "gui/WndUtil.c" "gui/AddWnd.c" "gui/AddWnd.h" gui/FontUtil.c gui/FontUtil.h gui/NoteWnd.c gui/NoteWnd.h)
add_executable(TeamProject
main.c "console/ConsoleSettings.c" "console/ConsoleSettings.h"
"console/ConsoleSettings.c" "console/ConsoleSettings.h"
gui/WndUtil.c gui/WndUtil.h linked_list/struct_def.h
note/note.h)
@ -28,7 +28,7 @@ add_executable(TeamProject
add_executable(hylTest note/note.h note/note.c note/note_add.c note/note_out.c)
# jzyTest
add_executable(jzyTest note_by_jzy/note.c note_by_jzy/note.h note_by_jzy/menu.c note_by_jzy/menu.h note_by_jzy/test.c note_by_jzy/notebook.c note_by_jzy/notebook.h)
add_executable(jzyTest note_by_jzy/menu.c note_by_jzy/menu.h main.c)
target_link_libraries(jzyTest ConsoleLib)
target_link_libraries(jzyTest GuiLib)

View File

@ -21,11 +21,13 @@
#define ID_ADD_BTN 0x01
#define ID_MODIFY_BTN 0x02
#define ID_MODIFY_WEEK_BTN 0x02
#define ID_DELETE_WEEK_BTN 0x03
#define ID_MODIFY_DAY_BTN 0x03
#define ID_DELETE_DAY_BTN 0x04
#define ID_DELETE_WEEK_BTN 0x04
#define ID_DELETE_DAY_BTN 0x05
#define ID_NOTE_BTN 0x09
@ -111,17 +113,31 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
NULL
);
HWND hWndModifyBtn = CreateWindowEx(
HWND hWndModifWeekBtn = CreateWindowEx(
WS_EX_LEFT,
L"Button",
L"修改",
L"修改周计划",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
24,
361,
144,
70,
24,
hWnd,
(HMENU) ID_MODIFY_BTN,
(HMENU) ID_MODIFY_WEEK_BTN,
(HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
NULL
);
HWND hWndModifyDayBtn = CreateWindowEx(
WS_EX_LEFT,
L"Button",
L"修改日计划",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
98,
361,
70,
24,
hWnd,
(HMENU) ID_MODIFY_DAY_BTN,
(HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
NULL
);
@ -191,7 +207,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
NULL
);
// 计划显示框
// 计划显示框
day_edit = CreateWindowEx(
0, L"ListBox",
NULL,
@ -318,7 +334,8 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
get_data(&current_data);
callRePaint(hWnd, &disp, text_metric);
break;
case ID_MODIFY_BTN:
case ID_MODIFY_WEEK_BTN:
case ID_MODIFY_DAY_BTN:
// 修改
put_data(current_data);
open_add_window(hWnd, true);

31
main.c
View File

@ -1,27 +1,10 @@
#include <windows.h>
#include <stdio.h>
#include <stdbool.h>
#include "console/ConsoleSettings.h"
#include "gui/WndUtil.h"
#include <locale.h>
//
// Created by JZYFC on 2021/12/3.
//
#include "note_by_jzy/menu.h"
int main() {
// Initialize standard output
update_stdout_handle(GetStdHandle(STD_OUTPUT_HANDLE));
// 确保 wprintf 可以正常输出中文,如删去此行,则应使用 WriteConsoleW Windows限定输出中文
// 空字符串,更好的系统语言支持
setlocale(LC_ALL, "");
wchar_t str[10];
wscanf(L"%ls", str);
wprintf(L"%s", str);
//// Window test
// create_and_show_main_window(100, 100, 300, 200, L"mWndClass", L"你い");
system("pause");
int main(void) {
main_menu();
return 0;
}
}

View File

@ -29,7 +29,7 @@ void delete_note_in_tag(wchar_t *tag,Note *note){//删除标签下链表中的
}
if(tag_node->note_list==NULL)
delete_tag(tag_node);
return ;
return;
}
void put_one_note(Note* note){
wprintf(L"title:%s\t\t", note->title);

View File

@ -1,5 +0,0 @@
//
// Created by JZYFC on 2021/11/29.
//
#include "note.h"

View File

@ -1,8 +0,0 @@
//
// Created by JZYFC on 2021/11/29.
//
#ifndef TEAMPROJECT_NOTE_H
#define TEAMPROJECT_NOTE_H
#endif //TEAMPROJECT_NOTE_H

View File

@ -1,18 +0,0 @@
//
// Created by JZYFC on 2021/12/9.
//
#include "notebook.h"
bool create_note_file(Path path) {
}
bool open_note(Path path) {
FILE *file = NULL;
char str[MAX_PATH_LENGTH];
wcstombs(str, path.path, path.len);
file = fopen(str, "r");
return false;
}

View File

@ -1,21 +0,0 @@
//
// Created by JZYFC on 2021/12/9.
//
#ifndef TEAMPROJECT_NOTEBOOK_H
#define TEAMPROJECT_NOTEBOOK_H
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#define MAX_PATH_LENGTH 50
typedef struct {
wchar_t path[MAX_PATH_LENGTH];
int len;
} Path;
bool open_note(Path path);
#endif //TEAMPROJECT_NOTEBOOK_H

View File

@ -1,10 +0,0 @@
//
// Created by JZYFC on 2021/12/3.
//
#include "menu.h"
int main(void) {
main_menu();
return 0;
}

View File

@ -1,6 +1,6 @@
#ifndef TWAMPRIJECT_ADDNEW_H
#define TEAMPROJECT_ADDNEW_H
#include<stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include "../linked_list/struct_def.h"
#include "../inout/ddlinout.h"

View File

@ -1,14 +1,16 @@
#include "printall.h"
void printall(list_head head){
void printall(list_head head) {
struct m_day_node *p;
for(p=head->next;p!=NULL;p=p->next){
wprintf(L"id: %d",p->data.number);
wprintf(L"开始时间: %d年%d月%d日%d时%d分\n",p->data.start_date.year,p->data.start_date.month,p->data.start_date.day,p->data.start_date.hour,p->data.start_date.minute);
wprintf(L"结束时间: %d年%d月%d日%d时%d分\n",p->data.due_date.year,p->data.due_date.month,p->data.due_date.day,p->data.due_date.hour,p->data.due_date.minute);
wprintf(L"事件内容: ");
wprintf(L"%s",p->data.todo);
for (p = head->next; p != NULL; p = p->next) {
wprintf(L"id: %d", p->data.number);
wprintf(L"开始时间: %d年%d月%d日%d时%d分\n", p->data.start_date.year, p->data.start_date.month, p->data.start_date.day,
p->data.start_date.hour, p->data.start_date.minute);
wprintf(L"结束时间: %d年%d月%d日%d时%d分\n", p->data.due_date.year, p->data.due_date.month, p->data.due_date.day,
p->data.due_date.hour, p->data.due_date.minute);
wprintf(L"事件内容: ");
wprintf(L"%s", p->data.todo);
}
}

20
total.md Normal file
View File

@ -0,0 +1,20 @@
- 程序入口: note_by_jzy/main.c
- 修改计划: zm
- 删除计划: zm
- 查找计划: note_by_WDC/search.h
note_by_WDC/search.c
- 增加计划: note_by_ps/addnew.c
note_by_ps/addnew.h
- 打开笔记本: note/note.c
note/note.h
note/note_add.c
note/note_out.c
note/text.c
- 图形界面: gui/AddWnd.c
gui/AddWnd.h
gui/FontUtil.c
gui/FontUtil.h
gui/NoteWnd.c
gui/NoteWnd.h
gui/WndUtil.c
gui/WndUtil.h