Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
karudu
/
C-editor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cb6b509a
authored
Mar 23, 2022
by
karudu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
parent
cd8c5722
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
ceditor.h
tab.c
ui.c
ceditor.h
View file @
cb6b509a
#ifndef CEDITOR_H
#define CEDITOR_H
#define SOURCEVIEW
#include <gtk/gtk.h>
#ifdef SOURCEVIEW
...
...
@@ -25,11 +27,8 @@ typedef struct
GtkWidget
*
Box
;
// Akna box
GtkWidget
*
MenuBar
;
// Ülaosa menüü
GtkWidget
*
Notebook
;
// Notebook vahekaartidega
<<<<<<<
Updated
upstream
=======
GtkWidget
*
ToolBar
;
//Tool bar
GtkWidget
*
AccelGroup
;
// Accel group nuppude jaoks
>>>>>>>
Stashed
changes
// Viited nuppudele nende sisse/välja lülitamiseks
GtkWidget
*
FailMenuAva
;
...
...
@@ -40,6 +39,10 @@ typedef struct
tab
*
Tabid
;
// Vahekaartide massiiv
int
PraeguneTab
;
// Praegune valitud vahekaart
int
TabidN
;
// Mitu vahekaarti on avatud
//toolbari nupud
GtkToolItem
*
Undo
;
//undo nupp
GtkToolItem
*
Redo
;
//redo nupp
}
ui
;
#endif // CEDITOR_H
tab.c
View file @
cb6b509a
...
...
@@ -32,7 +32,6 @@ void LisaTab(ui *UI)
gtk_container_add
(
GTK_CONTAINER
(
Tab
->
ScrollWindow
),
Tab
->
TextView
);
// Scroll aknasse läheb tekstiaken
gtk_scrolled_window_set_policy
(
GTK_SCROLLED_WINDOW
(
Tab
->
ScrollWindow
),
GTK_POLICY_AUTOMATIC
,
GTK_POLICY_AUTOMATIC
);
// Konfigureerimine
gtk_scrolled_window_set_shadow_type
(
GTK_SCROLLED_WINDOW
(
Tab
->
ScrollWindow
),
GTK_SHADOW_ETCHED_IN
);
// Status bar
Tab
->
StatusBar
=
gtk_statusbar_new
();
// Teksti muutuse callback, uuendab rida/veergu
...
...
@@ -53,6 +52,8 @@ void LisaTab(ui *UI)
gtk_widget_show_all
(
UI
->
Notebook
);
// Värskenda, et näha oleks
UuendaRidaVeerg
(
GTK_TEXT_BUFFER
(
Tab
->
Puhver
),
GTK_STATUSBAR
(
Tab
->
StatusBar
));
// Uuenda status bar'i, et seal midagi oleks
gtk_source_view_set_show_line_numbers
(
GTK_SOURCE_VIEW
(
Tab
->
TextView
),
TRUE
);
//naita reanumbrid
}
// Kustuta vahekaarti indeksil
...
...
@@ -60,7 +61,6 @@ void KustutaTab(ui *UI, int Indeks)
{
// Kustuta vahekaart
gtk_notebook_remove_page
(
GTK_NOTEBOOK
(
UI
->
Notebook
),
Indeks
);
int
TabidN
=
UI
->
TabidN
;
// Kui massiivis on pärast kustutatud vahekaarti neid veel,
// siis nihuta need õigele kohale
...
...
ui.c
View file @
cb6b509a
...
...
@@ -106,8 +106,22 @@ ui *LooUI()
MenuSeparator
(
FailMenu
);
LisaMenuItem
(
UI
,
FailMenu
,
FailMenuValju
,
Valju
,
GDK_KEY_Q
,
GDK_CONTROL_MASK
|
GDK_SHIFT_MASK
);
// Fail->Välju
//ToolBar
UI
->
ToolBar
=
gtk_toolbar_new
();
gtk_toolbar_set_style
(
GTK_TOOLBAR
(
UI
->
ToolBar
),
GTK_TOOLBAR_ICONS
);
GtkWidget
*
UndoIcon
=
gtk_image_new_from_icon_name
(
GTK_STOCK_UNDO
,
5
);
UI
->
Undo
=
gtk_tool_button_new
(
UndoIcon
,
"undo"
);
GtkWidget
*
RedoIcon
=
gtk_image_new_from_icon_name
(
GTK_STOCK_REDO
,
5
);
UI
->
Redo
=
gtk_tool_button_new
(
RedoIcon
,
"redo"
);
//nupud toolbarile
gtk_toolbar_insert
(
GTK_TOOLBAR
(
UI
->
ToolBar
),
UI
->
Undo
,
-
1
);
gtk_toolbar_insert
(
GTK_TOOLBAR
(
UI
->
ToolBar
),
UI
->
Redo
,
-
1
);
// Pane kõik õiges järjekorras box'i
gtk_box_pack_start
(
GTK_BOX
(
UI
->
Box
),
UI
->
MenuBar
,
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
UI
->
Box
),
UI
->
ToolBar
,
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
UI
->
Box
),
UI
->
Notebook
,
TRUE
,
TRUE
,
0
);
return
UI
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment