diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-03-18 17:33:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-18 17:33:27 +0100 |
| commit | 5c482f9d9b357e098f955351f425bc985254ff28 (patch) | |
| tree | c410588ac915886aea4bef3478a12d682bb5ad9f /fluid/file.cxx | |
| parent | a9fb6a979fbcf31c2405d61ea720879bd5507d02 (diff) | |
Fix and update alignment #346 (#701)
* interactive layout alignment rewritten
* interface for new alignment rules
* new alignment dialog box
* user defined layout rules added
* layout rules can be stored in projects, settings, and external files
* Valgrind verification
Diffstat (limited to 'fluid/file.cxx')
| -rw-r--r-- | fluid/file.cxx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/fluid/file.cxx b/fluid/file.cxx index db59a2733..2da570f3a 100644 --- a/fluid/file.cxx +++ b/fluid/file.cxx @@ -159,6 +159,10 @@ int Fd_Project_Reader::close_read() { return 1; } +const char *Fd_Project_Reader::filename_name() { + return fl_filename_name(fname); +} + /** Convert an ASCII sequence form the \.fl file that starts with a \\ into a single character. Conversion includes the common C style \\ characters like \\n, \\x## hex @@ -309,7 +313,12 @@ void Fd_Project_Reader::read_children(Fl_Type *p, int paste, Strategy strategy, goto CONTINUE; } - if (!strcmp(c, "snap") || !strcmp(c, "gridx") || !strcmp(c, "gridy")) { + if (!strcmp(c, "snap")) { + g_layout_list.read(this); + goto CONTINUE; + } + + if (!strcmp(c, "gridx") || !strcmp(c, "gridy")) { // grid settings are now global read_word(); goto CONTINUE; @@ -523,6 +532,15 @@ const char *Fd_Project_Reader::read_word(int wantbrace) { } } +int Fd_Project_Reader::read_int() { + const char *word = read_word(); + if (word) { + return atoi(word); + } else { + return 0; + } +} + int Fd_Project_Reader::read_fdesign_line(const char*& name, const char*& value) { int length = 0; int x; @@ -791,7 +809,7 @@ int Fd_Project_Writer::write_project(const char *filename, int selected_only) { if (!selected_only) { write_string("\nheader_name"); write_word(g_project.header_file_name.c_str()); write_string("\ncode_name"); write_word(g_project.code_file_name.c_str()); - + g_layout_list.write(this); #if 0 // https://github.com/fltk/fltk/issues/328 // Project wide settings require a redesign. |
