1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_scui.hxx" 26 27 #undef SC_DLLIMPLEMENTATION 28 29 30 31 //------------------------------------------------------------------ 32 33 #include "inscldlg.hxx" 34 #include "scresid.hxx" 35 #include "miscdlgs.hrc" 36 37 38 static sal_uInt8 nInsItemChecked=0; 39 40 //================================================================== 41 42 ScInsertCellDlg::ScInsertCellDlg( Window* pParent,sal_Bool bDisallowCellMove) : 43 ModalDialog ( pParent, ScResId( RID_SCDLG_INSCELL ) ), 44 // 45 aFlFrame ( this, ScResId( FL_FRAME ) ), 46 aBtnCellsDown ( this, ScResId( BTN_CELLSDOWN ) ), 47 aBtnCellsRight ( this, ScResId( BTN_CELLSRIGHT ) ), 48 aBtnInsRows ( this, ScResId( BTN_INSROWS ) ), 49 aBtnInsCols ( this, ScResId( BTN_INSCOLS ) ), 50 aBtnOk ( this, ScResId( BTN_OK ) ), 51 aBtnCancel ( this, ScResId( BTN_CANCEL ) ), 52 aBtnHelp ( this, ScResId( BTN_HELP ) ) 53 { 54 if (bDisallowCellMove) 55 { 56 aBtnCellsDown.Disable(); 57 aBtnCellsRight.Disable(); 58 aBtnInsRows.Check(); 59 60 switch(nInsItemChecked) 61 { 62 case 2: aBtnInsRows .Check();break; 63 case 3: aBtnInsCols .Check();break; 64 default:aBtnInsRows .Check();break; 65 } 66 } 67 else 68 { 69 switch(nInsItemChecked) 70 { 71 case 0: aBtnCellsDown .Check();break; 72 case 1: aBtnCellsRight.Check();break; 73 case 2: aBtnInsRows .Check();break; 74 case 3: aBtnInsCols .Check();break; 75 } 76 } 77 //------------- 78 FreeResource(); 79 } 80 81 //------------------------------------------------------------------------ 82 83 InsCellCmd ScInsertCellDlg::GetInsCellCmd() const 84 { 85 InsCellCmd nReturn = INS_NONE; 86 87 if ( aBtnCellsDown.IsChecked() ) 88 { 89 nInsItemChecked=0; 90 nReturn = INS_CELLSDOWN; 91 } 92 else if ( aBtnCellsRight.IsChecked()) 93 { 94 nInsItemChecked=1; 95 nReturn = INS_CELLSRIGHT; 96 } 97 else if ( aBtnInsRows.IsChecked() ) 98 { 99 nInsItemChecked=2; 100 nReturn = INS_INSROWS; 101 } 102 else if ( aBtnInsCols.IsChecked() ) 103 { 104 nInsItemChecked=3; 105 nReturn = INS_INSCOLS; 106 } 107 108 return nReturn; 109 } 110 111 __EXPORT ScInsertCellDlg::~ScInsertCellDlg() 112 { 113 } 114 115 116 117