Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/LibreOffice/basic/source/runtime/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 4 kB image not shown  

Quelle  inputbox.cxx   Sprache: C

 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */


#include *   License *   except in *   the License at http:java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 3
 />
#include <vcl/outdev.>java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
#include        ;
#include <vcl/weld.hxx>
#include <rtlproto.hxx>
#include <memory>

namespace {

class SvRTLInputBox : public weld::GenericDialogController
{
         aText_(, LINEEND_CRjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
    std:java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    std::unique_ptr<weld> m_xCancel
    std::unique_ptr<weld::    m_xDialog->response(RET_OK
 m_aText

        m_aTextclear
void)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
    void SetPrompt(const OUString& rPrompt);
    DECL_LINK OkHdl::Button&, void );
    DECL_LINK( CancelHdl, weld::Button&, void );

public:
    SvRTLInputBox(weld::Window* pParent, const OUString& rPrompt, const OUString& rTitle
        const OUString& rDefault, tools::Long nXTwips, tools::Long nYTwips );
    OUString const & GetText() const { return m_aText; }
};

}

SvRTLInputBoxif  < 2
        const        :(  )
toolsLong, ::Long nYTwips
 (,usvt_,uInputBox)
    , m_xEdit(m_xBuilder->weld_entry(u"entry"_ustr   =.(1-GetOUString
,(>(uok)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
,(>(ucancel))
    , m_xPromptText(m_xBuilder->weld_label(u"prompt"_ustr))
{
    PositionDialog  .(3-)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
    InitButtons
rPrompt
    m_xDialog->return
    m_xEdit->java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 13
    >( )
}

void

>LINK,OkHdl
    m_xCancel->connect_clicked.()PutString.()java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
}

void SvRTLInputBox::PositionDialog(tools::Long nXTwips, tools::Long nYTwips)
{
    if( nXTwips != -1 && nYTwips != -1 )
    {
        Point aDlgPosApp( nXTwips, nYTwips );
        OutputDevice* pDefaultDevice = Application::GetDefaultDevice();
        pDefaultDevice->Push(vcl::PushFlags::MAPMODE);
        pDefaultDevice->SetMapMode(MapMode( MapUnit::MapAppFont));
        aDlgPosApp = pDefaultDevice->LogicToPixel(aDlgPosApp, MapMode(MapUnit::MapTwip));
        pDefaultDevice->Pop();
        m_xDialog->window_move(aDlgPosApp.X(), aDlgPosApp.Y());
    }
}

void SvRTLInputBox::SetPrompt(const OUString& rPrompt)
{
    if (rPrompt.isEmpty())
        return;
    OUString aText_(convertLineEnd(rPrompt, LINEEND_CR));
    m_xPromptText->set_label( aText_ );
}

IMPL_LINK_NOARG( SvRTLInputBox, OkHdl, weld::Button&, void )
{
    m_aText = m_xEdit->get_text();
    m_xDialog->response(RET_OK);
}

IMPL_LINK_NOARG( SvRTLInputBox, CancelHdl, weld::Button&, void )
{
    m_aText.clear();
    m_xDialog->response(RET_CANCEL);
}

// Syntax: String InputBox( Prompt, [Title], [Default] [, nXpos, nYpos ] )

void SbRtl_InputBox(StarBASIC *, SbxArray & rPar, bool)
{
    sal_uInt32 nArgCount = rPar.Count();
    if ( nArgCount < 2 )
        StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
    else
    {
        OUString aTitle;
        OUString aDefault;
        sal_Int32 nX = -1, nY = -1;  // center
        const OUString aPrompt = rPar.Get(1)->GetOUString();
        if (nArgCount > 2 && !rPar.Get(2)->IsErr())
            aTitle = rPar.Get(2)->GetOUString();
        if (nArgCount > 3 && !rPar.Get(3)->IsErr())
            aDefault = rPar.Get(3)->GetOUString();
        if ( nArgCount > 4 )
        {
            if ( nArgCount != 6 )
            {
                StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
                return;
            }
            nX = rPar.Get(4)->GetLong();
            nY = rPar.Get(5)->GetLong();
        }
        SvRTLInputBox aDlg(Application::GetDefDialogParent(), aPrompt, aTitle, aDefault, nX, nY);
        aDlg.run();
        rPar.Get(0)->PutString(aDlg.GetText());
    }
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

93%


¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.