From ac18bf760907d148490594a1a38dfa311978fcef Mon Sep 17 00:00:00 2001
From: Matthias Melcher An example to compute the area inside a widget's box():
These functions are mainly useful in the draw() code
for deriving custom widgets, where one wants to avoid drawing
diff --git a/documentation/Fl_File_Browser.html b/documentation/Fl_File_Browser.html
index b23c6cf87..c53352d4d 100644
--- a/documentation/Fl_File_Browser.html
+++ b/documentation/Fl_File_Browser.html
@@ -20,7 +20,7 @@
- int X = yourwidget->x() + Fl::box_dx(yourwidget->box());
- int Y = yourwidget->y() + Fl::box_dy(yourwidget->box());
- int W = yourwidget->w() - Fl::box_dw(yourwidget->box());
- int H = yourwidget->h() - Fl::box_dh(yourwidget->box());
+ int X = yourwidget->x() + Fl::box_dx(yourwidget->box());
+ int Y = yourwidget->y() + Fl::box_dy(yourwidget->box());
+ int W = yourwidget->w() - Fl::box_dw(yourwidget->box());
+ int H = yourwidget->h() - Fl::box_dh(yourwidget->box());
Include Files
-#include <FL/Fl_File_Browser.H>
+#include <FL/Fl_File_Browser.H>
Description
diff --git a/documentation/Fl_File_Chooser.html b/documentation/Fl_File_Chooser.html
index 62f648a2b..1b0e09d44 100644
--- a/documentation/Fl_File_Chooser.html
+++ b/documentation/Fl_File_Chooser.html
@@ -18,7 +18,7 @@
Include Files
-#include <FL/Fl_File_Chooser.H>
+#include <FL/Fl_File_Chooser.H>
Description
diff --git a/documentation/Fl_File_Icon.html b/documentation/Fl_File_Icon.html
index 132200eb2..53b7ff8f6 100644
--- a/documentation/Fl_File_Icon.html
+++ b/documentation/Fl_File_Icon.html
@@ -18,7 +18,7 @@
Include Files
-#include <FL/Fl_File_Icon.H>
+#include <FL/Fl_File_Icon.H>
Description
diff --git a/documentation/Fl_Group.html b/documentation/Fl_Group.html
index 14a0aedc2..ac19bb771 100644
--- a/documentation/Fl_Group.html
+++ b/documentation/Fl_Group.html
@@ -128,7 +128,7 @@ memory.
You could examine the boxtype in by doing -box->box(). FLTK uses method name overloading to make +box->box(). FLTK uses method name overloading to make short names for get/set methods. A "set" method is always of the form "void name(type)", and a "get" method is always of the form "type name() const".
diff --git a/documentation/common.html b/documentation/common.html index 18fbc22c5..6462bc24f 100644 --- a/documentation/common.html +++ b/documentation/common.html @@ -406,7 +406,7 @@ sign. Figure 3-4 shows the available symbols.Thus, to show a very large arrow pointing downward you would use the -label string "@+92->". +label string "@+92->".
class Foo {
void my_callback(Fl_Widget *w);
- static void my_static_callback(Fl_Widget *w, void *f) { ((Foo *)f)->my_callback(w); }
+ static void my_static_callback(Fl_Widget *w, void *f) { ((Foo *)f)->my_callback(w); }
...
}
...
-w->callback(my_static_callback, (void *)this);
+w->callback(my_static_callback, (void *)this);
diff --git a/documentation/drawing.html b/documentation/drawing.html
index f734ce34a..f003e5a43 100644
--- a/documentation/drawing.html
+++ b/documentation/drawing.html
@@ -659,7 +659,7 @@ Without the conversion call, the label on OS X would read
Fahrvergn¸gen with a deformed umlaut u.
btn = new Fl_Button(10, 10, 300, 25);
- btn->copy_label(fl_latin1_to_local("Fahrvergnügen"));
+ btn->copy_label(fl_latin1_to_local("Fahrvergnügen"));
If your application uses characters that are not part of both @@ -933,7 +933,7 @@ image, and this area is left unchanged.
Draws the image with the upper-left corner at x,y. -This is the same as doing draw(x,y,img->w(),img->h(),0,0). +This is the same as doing draw(x,y,img->w(),img->h(),0,0).
-w->editor = new Fl_Text_Editor(0, 30, 640, 370); -w->editor->buffer(textbuf); +w->editor = new Fl_Text_Editor(0, 30, 640, 370); +w->editor->buffer(textbuf);
So that we can keep track of changes to the file, we also want to add a "modify" callback:
-textbuf->add_modify_callback(changed_cb, w); -textbuf->call_modify_callbacks(); +textbuf->add_modify_callback(changed_cb, w); +textbuf->call_modify_callbacks();
Finally, we want to use a mono-spaced font like FL_COURIER:
-w->editor->textfont(FL_COURIER); +w->editor->textfont(FL_COURIER);
void copy_cb(Fl_Widget*, void* v) {
EditorWindow* e = (EditorWindow*)v;
- Fl_Text_Editor::kf_copy(0, e->editor);
+ Fl_Text_Editor::kf_copy(0, e->editor);
}
@@ -212,7 +212,7 @@ to cut the currently selected text to the clipboard:
void cut_cb(Fl_Widget*, void* v) {
EditorWindow* e = (EditorWindow*)v;
- Fl_Text_Editor::kf_cut(0, e->editor);
+ Fl_Text_Editor::kf_cut(0, e->editor);
}
@@ -224,7 +224,7 @@ to delete the currently selected text to the clipboard:
void delete_cb(Fl_Widget*, void* v) {
- textbuf->remove_selection();
+ textbuf->remove_selection();
}
@@ -240,10 +240,10 @@ void find_cb(Fl_Widget* w, void* v) {
EditorWindow* e = (EditorWindow*)v;
const char *val;
- val = fl_input("Search String:", e->search);
+ val = fl_input("Search String:", e->search);
if (val != NULL) {
// User entered a string - go find it!
- strcpy(e->search, val);
+ strcpy(e->search, val);
find2_cb(w, v);
}
@@ -257,21 +257,21 @@ search dialog:
void find2_cb(Fl_Widget* w, void* v) {
EditorWindow* e = (EditorWindow*)v;
- if (e->search[0] == '\0') {
+ if (e->search[0] == '\0') {
// Search string is blank; get a new one...
find_cb(w, v);
return;
}
- int pos = e->editor->insert_position();
- int found = textbuf->search_forward(pos, e->search, &pos);
+ int pos = e->editor->insert_position();
+ int found = textbuf->search_forward(pos, e->search, &pos);
if (found) {
// Found a match; select and update the position...
- textbuf->select(pos, pos+strlen(e->search));
- e->editor->insert_position(pos+strlen(e->search));
- e->editor->show_insert_position();
+ textbuf->select(pos, pos+strlen(e->search));
+ e->editor->insert_position(pos+strlen(e->search));
+ e->editor->show_insert_position();
}
- else fl_alert("No occurrences of \'%s\' found!", e->search);
+ else fl_alert("No occurrences of \'%s\' found!", e->search);
}
@@ -289,10 +289,10 @@ void new_cb(Fl_Widget*, void*) {
if (!check_save()) return;
filename[0] = '\0';
- textbuf->select(0, textbuf->length());
- textbuf->remove_selection();
+ textbuf->select(0, textbuf->length());
+ textbuf->remove_selection();
changed = 0;
- textbuf->call_modify_callbacks();
+ textbuf->call_modify_callbacks();
}
@@ -323,7 +323,7 @@ to paste the clipboard at the current position:
void paste_cb(Fl_Widget*, void* v) {
EditorWindow* e = (EditorWindow*)v;
- Fl_Text_Editor::kf_paste(0, e->editor);
+ Fl_Text_Editor::kf_paste(0, e->editor);
}
@@ -569,7 +569,7 @@ void set_title(Fl_Window* w) {
if (changed) strcat(title, " (modified)");
- w->label(title);
+ w->label(title);
}
@@ -587,9 +587,9 @@ int main(int argc, char **argv) {
Fl_Window* window = new_view();
- window->show(1, argv);
+ window->show(1, argv);
- if (argc > 1) load_file(argv[1], -1);
+ if (argc > 1) load_file(argv[1], -1);
return Fl::run();
}
@@ -642,7 +642,7 @@ size of the text that is drawn.
Styles are defined using the
Fl_Text_Display::Style_Table_Entry structure
-defined in <FL/Fl_Text_Display.H>:
+defined in <FL/Fl_Text_Display.H>:
struct Style_Table_Entry {
@@ -683,7 +683,7 @@ style data and buffer with the text editor widget:
Fl_Text_Buffer *stylebuf;
-w->editor->highlight_data(stylebuf, styletable,
+w->editor->highlight_data(stylebuf, styletable,
sizeof(styletable) / sizeof(styletable[0]),
'A', style_unfinished_cb, 0);
@@ -692,7 +692,7 @@ w->editor->highlight_data(stylebuf, styletable,
that changes to the text buffer are mirrored in the style buffer:
-textbuf->add_modify_callback(style_update, w->editor); +textbuf->add_modify_callback(style_update, w->editor);
The style_update() function, like the change_cb()
@@ -721,43 +721,43 @@ style_update(int pos, // I - Position of update
// If this is just a selection change, just unselect the style buffer...
if (nInserted == 0 && nDeleted == 0) {
- stylebuf->unselect();
+ stylebuf->unselect();
return;
}
// Track changes in the text buffer...
- if (nInserted > 0) {
+ if (nInserted > 0) {
// Insert characters into the style buffer...
style = new char[nInserted + 1];
memset(style, 'A', nInserted);
style[nInserted] = '\0';
- stylebuf->replace(pos, pos + nDeleted, style);
+ stylebuf->replace(pos, pos + nDeleted, style);
delete[] style;
} else {
// Just delete characters in the style buffer...
- stylebuf->remove(pos, pos + nDeleted);
+ stylebuf->remove(pos, pos + nDeleted);
}
// Select the area that was just updated to avoid unnecessary
// callbacks...
- stylebuf->select(pos, pos + nInserted - nDeleted);
+ stylebuf->select(pos, pos + nInserted - nDeleted);
// Re-parse the changed region; we do this by parsing from the
// beginning of the line of the changed region to the end of
// the line of the changed region... Then we check the last
// style character and keep updating if we have a multi-line
// comment character...
- start = textbuf->line_start(pos);
- end = textbuf->line_end(pos + nInserted - nDeleted);
- text = textbuf->text_range(start, end);
- style = stylebuf->text_range(start, end);
+ start = textbuf->line_start(pos);
+ end = textbuf->line_end(pos + nInserted - nDeleted);
+ text = textbuf->text_range(start, end);
+ style = stylebuf->text_range(start, end);
last = style[end - start - 1];
style_parse(text, style, end - start);
- stylebuf->replace(start, end, style);
- ((Fl_Text_Editor *)cbArg)->redisplay_range(start, end);
+ stylebuf->replace(start, end, style);
+ ((Fl_Text_Editor *)cbArg)->redisplay_range(start, end);
if (last != style[end - start - 1]) {
// The last character on the line changed styles, so reparse the
@@ -765,14 +765,14 @@ style_update(int pos, // I - Position of update
free(text);
free(style);
- end = textbuf->length();
- text = textbuf->text_range(start, end);
- style = stylebuf->text_range(start, end);
+ end = textbuf->length();
+ text = textbuf->text_range(start, end);
+ style = stylebuf->text_range(start, end);
style_parse(text, style, end - start);
- stylebuf->replace(start, end, style);
- ((Fl_Text_Editor *)cbArg)->redisplay_range(start, end);
+ stylebuf->replace(start, end, style);
+ ((Fl_Text_Editor *)cbArg)->redisplay_range(start, end);
}
free(text);
@@ -800,7 +800,7 @@ style_parse(const char *text,
*bufptr;
const char *temp;
- for (current = *style, col = 0, last = 0; length > 0; length --, text ++) {
+ for (current = *style, col = 0, last = 0; length > 0; length --, text ++) {
if (current == 'A') {
// Check for directives, comments, strings, and keywords...
if (col == 0 && *text == '#') {
diff --git a/documentation/enumerations.html b/documentation/enumerations.html
index 2e88f8778..49acbcbe7 100644
--- a/documentation/enumerations.html
+++ b/documentation/enumerations.html
@@ -138,7 +138,7 @@ FL_KEYBOARD and FL_SHORTCUT events:
-cube->pany(((Fl_Slider *)o)->value()); +cube->pany(((Fl_Slider *)o)->value()); cube->redraw();diff --git a/documentation/migration.html b/documentation/migration.html index a74347c08..1f940044e 100644 --- a/documentation/migration.html +++ b/documentation/migration.html @@ -54,9 +54,9 @@ symbol on the command-line when you compile
#define FLTK_1_0_COMPAT -#include <FL/Fl.H> -#include <FL/Enumerations.H> -#include <FL/filename.H> +#include <FL/Fl.H> +#include <FL/Enumerations.H> +#include <FL/filename.H>
The following table shows the old and new function names:
diff --git a/documentation/osissues.html b/documentation/osissues.html index a838b7a87..79c385a86 100644 --- a/documentation/osissues.html +++ b/documentation/osissues.html @@ -705,7 +705,7 @@ applications will NOT copy any resource forks! For copying and moving use CpMac and MvMac respectively. For creating a tar archive, all executables need to be stripped from their Resource Fork before -packing, e.g. "DeRez fluid >fluid.r". After unpacking the +packing, e.g. "DeRez fluid > fluid.r". After unpacking the Resource Fork needs to be reattached, e.g. "Rez fluid.r -o fluid". -- cgit v1.2.3