aquaprintaccessoryview.mm (a95ab8f1) aquaprintaccessoryview.mm (cd426cce)
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

--- 791 unchanged lines hidden (view full) ---

800static void addBool( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
801 const rtl::OUString& rText, sal_Bool bEnabled,
802 const rtl::OUString& rProperty, sal_Bool bValue,
803 std::vector<ColumnItem >& rRightColumn,
804 ControllerProperties* pControllerProperties,
805 ControlTarget* pCtrlTarget
806 )
807{
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

--- 791 unchanged lines hidden (view full) ---

800static void addBool( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
801 const rtl::OUString& rText, sal_Bool bEnabled,
802 const rtl::OUString& rProperty, sal_Bool bValue,
803 std::vector<ColumnItem >& rRightColumn,
804 ControllerProperties* pControllerProperties,
805 ControlTarget* pCtrlTarget
806 )
807{
808 NSRect aCheckRect = { { rCurX + nAttachOffset, 0 }, { 0, 15 } };
808 NSRect aCheckRect = NSMakeRect( rCurX + nAttachOffset, 0, 0, 15);
809 NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
810 [pBtn setButtonType: NSSwitchButton];
811 [pBtn setState: bValue ? NSOnState : NSOffState];
812 if( ! bEnabled )
813 [pBtn setEnabled: NO];
814 linebreakCell( [pBtn cell], rText );
815 [pBtn sizeToFit];
816

--- 52 unchanged lines hidden (view full) ---

869
870 // indent the radio group relative to the text
871 // nOff = 20;
872 }
873
874 // setup radio matrix
875 NSButtonCell* pProto = [[NSButtonCell alloc] init];
876
809 NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
810 [pBtn setButtonType: NSSwitchButton];
811 [pBtn setState: bValue ? NSOnState : NSOffState];
812 if( ! bEnabled )
813 [pBtn setEnabled: NO];
814 linebreakCell( [pBtn cell], rText );
815 [pBtn sizeToFit];
816

--- 52 unchanged lines hidden (view full) ---

869
870 // indent the radio group relative to the text
871 // nOff = 20;
872 }
873
874 // setup radio matrix
875 NSButtonCell* pProto = [[NSButtonCell alloc] init];
876
877 NSRect aRadioRect = { { rCurX + nOff, 0 }, { 280 - rCurX, 5*rChoices.getLength() } };
877 NSRect aRadioRect = NSMakeRect( rCurX + nOff, 0, 280 - rCurX, 5*rChoices.getLength());
878 [pProto setTitle: @"RadioButtonGroup"];
879 [pProto setButtonType: NSRadioButton];
880 NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
881 mode: NSRadioModeMatrix
882 prototype: (NSCell*)pProto
883 numberOfRows: rChoices.getLength()
884 numberOfColumns: 1];
885 // set individual titles

--- 41 unchanged lines hidden (view full) ---

927 // don't indent attached lists, looks bad in the existing cases
928 NSControl* pTextView = createLabel( rText );
929 [pCurParent addSubview: [pTextView autorelease]];
930 rLeftColumn.push_back( ColumnItem( pTextView ) );
931 NSRect aTextRect = [pTextView frame];
932 aTextRect.origin.x = rCurX /* + nAttachOffset*/;
933
934 // don't indent attached lists, looks bad in the existing cases
878 [pProto setTitle: @"RadioButtonGroup"];
879 [pProto setButtonType: NSRadioButton];
880 NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
881 mode: NSRadioModeMatrix
882 prototype: (NSCell*)pProto
883 numberOfRows: rChoices.getLength()
884 numberOfColumns: 1];
885 // set individual titles

--- 41 unchanged lines hidden (view full) ---

927 // don't indent attached lists, looks bad in the existing cases
928 NSControl* pTextView = createLabel( rText );
929 [pCurParent addSubview: [pTextView autorelease]];
930 rLeftColumn.push_back( ColumnItem( pTextView ) );
931 NSRect aTextRect = [pTextView frame];
932 aTextRect.origin.x = rCurX /* + nAttachOffset*/;
933
934 // don't indent attached lists, looks bad in the existing cases
935 NSRect aBtnRect = { { rCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0 }, { 0, 15 } };
935 NSRect aBtnRect = NSMakeRect( rCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0, 0, 15);
936 NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO];
937
938 // iterate options
939 for( sal_Int32 m = 0; m < rChoices.getLength(); m++ )
940 {
941 NSString* pItemText = CreateNSString( rChoices[m] );
942 [pBtn addItemWithTitle: pItemText];
943 NSMenuItem* pItem = [pBtn itemWithTitle: pItemText];

--- 59 unchanged lines hidden (view full) ---

1003
1004 // update nCurY
1005 rCurY = aTextRect.origin.y - 5;
1006
1007 // and set the offset for the real edit field
1008 nOff = aTextRect.size.width + 5;
1009 }
1010
936 NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO];
937
938 // iterate options
939 for( sal_Int32 m = 0; m < rChoices.getLength(); m++ )
940 {
941 NSString* pItemText = CreateNSString( rChoices[m] );
942 [pBtn addItemWithTitle: pItemText];
943 NSMenuItem* pItem = [pBtn itemWithTitle: pItemText];

--- 59 unchanged lines hidden (view full) ---

1003
1004 // update nCurY
1005 rCurY = aTextRect.origin.y - 5;
1006
1007 // and set the offset for the real edit field
1008 nOff = aTextRect.size.width + 5;
1009 }
1010
1011 NSRect aFieldRect = { { rCurX + nOff + nAttachOffset, 0 }, { 100, 25 } };
1011 NSRect aFieldRect = NSMakeRect( rCurX + nOff + nAttachOffset, 0, 100, 25);
1012 NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect];
1013 [pFieldView setEditable: YES];
1014 [pFieldView setSelectable: YES];
1015 [pFieldView setDrawsBackground: YES];
1016 [pFieldView sizeToFit]; // FIXME: this does nothing
1017 [pCurParent addSubview: [pFieldView autorelease]];
1018
1019 rRightColumn.push_back( ColumnItem( pFieldView ) );

--- 7 unchanged lines hidden (view full) ---

1027
1028 // move to nCurY
1029 aFieldRect.origin.y = rCurY - aFieldRect.size.height;
1030 [pFieldView setFrame: aFieldRect];
1031
1032 if( rCtrlType.equalsAscii( "Range" ) )
1033 {
1034 // add a stepper control
1012 NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect];
1013 [pFieldView setEditable: YES];
1014 [pFieldView setSelectable: YES];
1015 [pFieldView setDrawsBackground: YES];
1016 [pFieldView sizeToFit]; // FIXME: this does nothing
1017 [pCurParent addSubview: [pFieldView autorelease]];
1018
1019 rRightColumn.push_back( ColumnItem( pFieldView ) );

--- 7 unchanged lines hidden (view full) ---

1027
1028 // move to nCurY
1029 aFieldRect.origin.y = rCurY - aFieldRect.size.height;
1030 [pFieldView setFrame: aFieldRect];
1031
1032 if( rCtrlType.equalsAscii( "Range" ) )
1033 {
1034 // add a stepper control
1035 NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 5,
1036 aFieldRect.origin.y },
1037 { 15, aFieldRect.size.height } };
1035 NSRect aStepFrame = NSMakeRect(
1036 aFieldRect.origin.x + aFieldRect.size.width + 5, aFieldRect.origin.y,
1037 15, aFieldRect.size.height);
1038 NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame];
1039 [pStep setIncrement: 1];
1040 [pStep setValueWraps: NO];
1041 [pStep setTag: nTag];
1042 [pCurParent addSubview: [pStep autorelease]];
1043
1044 rRightColumn.back().pSubControl = pStep;
1045

--- 342 unchanged lines hidden ---
1038 NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame];
1039 [pStep setIncrement: 1];
1040 [pStep setValueWraps: NO];
1041 [pStep setTag: nTag];
1042 [pCurParent addSubview: [pStep autorelease]];
1043
1044 rRightColumn.back().pSubControl = pStep;
1045

--- 342 unchanged lines hidden ---