X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyx_gui_misc.C;h=dc3a66d7334b30c1945f1f96611a078d604cf7b9;hb=3df345c9383480f68fad51feae8b9c64425c8729;hp=701dbce478cde197246e47b65679dce0a6319d59;hpb=7f3b99126a14b04f6968040e7e87c8ac2135b684;p=lyx.git diff --git a/src/lyx_gui_misc.C b/src/lyx_gui_misc.C index 701dbce478..dc3a66d733 100644 --- a/src/lyx_gui_misc.C +++ b/src/lyx_gui_misc.C @@ -5,7 +5,7 @@ * LyX, The Document Processor * * Copyright 1995 Matthias Ettrich - * Copyright 1995-1999 The LyX Team. + * Copyright 1995-2000 The LyX Team. * * ====================================================== */ @@ -32,13 +32,13 @@ #include "insets/insetindex.h" #include "LyXView.h" +using std::pair; using std::make_pair; extern BufferView * current_view; extern FD_form_paragraph * fd_form_paragraph; extern FD_form_paragraph_extra * fd_form_paragraph_extra; -extern FD_form_search * fd_form_search; extern FD_form_character * fd_form_character; extern FD_form_document * fd_form_document; extern FD_form_paper * fd_form_paper; @@ -98,9 +98,6 @@ void CloseAllBufferRelatedPopups() if (fd_form_paragraph_extra->form_paragraph_extra->visible) { fl_hide_form(fd_form_paragraph_extra->form_paragraph_extra); } - if (fd_form_search->form_search->visible) { - fl_hide_form(fd_form_search->form_search); - } if (fd_form_character->form_character->visible) { fl_hide_form(fd_form_character->form_character); } @@ -372,11 +369,7 @@ bool AskQuestion(string const & s1, string const & s2, string const & s3) { fl_set_resource("flQuestion.yes.label", idex(_("Yes|Yy#y"))); fl_set_resource("flQuestion.no.label", idex(_("No|Nn#n"))); -#if FL_REVISION > 85 return fl_show_question((s1 + "\n" + s2 + "\n" + s3).c_str(), 0); -#else - return fl_show_question(s1.c_str(), s2.c_str(), s3.c_str()); -#endif } @@ -386,18 +379,10 @@ int AskConfirmation(string const & s1, string const & s2, string const & s3) fl_set_choices_shortcut(scex(_("Yes|Yy#y")), scex(_("No|Nn#n")), scex(_("Cancel|^["))); -#if FL_REVISION < 86 - return fl_show_choice(s1.c_str(), s2.c_str(), s3.c_str(), - 3, idex(_("Yes|Yy#y")), - idex(_("No|Nn#n")), - idex(_("Cancel|^["))); -#endif -#if FL_REVISION > 85 return fl_show_choice(s1.c_str(), s2.c_str(), s3.c_str(), 3, idex(_("Yes|Yy#y")), idex(_("No|Nn#n")), idex(_("Cancel|^[")), 3); -#endif } @@ -424,3 +409,11 @@ void WarnReadonly(string const & file) _("The document is read-only:"), file); } + +/// Get the dpi setting of the current screen +float getScreenDPI() +{ + Screen * scr = DefaultScreenOfDisplay(fl_get_display()); + return ((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) + + (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2; +}